Skip to content

LightsailClient#

Index > Lightsail > LightsailClient

Auto-generated documentation for Lightsail type annotations stubs module mypy-boto3-lightsail.

LightsailClient#

Type annotations and code completion for boto3.client("lightsail"). boto3 documentation

# LightsailClient usage example

from boto3.session import Session
from mypy_boto3_lightsail.client import LightsailClient

def get_lightsail_client() -> LightsailClient:
    return Session().client("lightsail")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("lightsail").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("lightsail")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.AccountSetupInProgressException,
    client.exceptions.ClientError,
    client.exceptions.InvalidInputException,
    client.exceptions.NotFoundException,
    client.exceptions.OperationFailureException,
    client.exceptions.ServiceException,
    client.exceptions.UnauthenticatedException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_lightsail.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

allocate_static_ip#

Allocates a static IP address.

Type annotations and code completion for boto3.client("lightsail").allocate_static_ip method.