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. boto3 documentation

# allocate_static_ip method definition

def allocate_static_ip(
    self,
    *,
    staticIpName: str,
) -> AllocateStaticIpResultTypeDef:  # (1)
    ...
  1. See AllocateStaticIpResultTypeDef
# allocate_static_ip method usage example with argument unpacking

kwargs: AllocateStaticIpRequestRequestTypeDef = {  # (1)
    "staticIpName": ...,
}

parent.allocate_static_ip(**kwargs)
  1. See AllocateStaticIpRequestRequestTypeDef

attach_certificate_to_distribution#

Attaches an SSL/TLS certificate to your Amazon Lightsail content delivery network (CDN) distribution.

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

# attach_certificate_to_distribution method definition

def attach_certificate_to_distribution(
    self,
    *,
    distributionName: str,
    certificateName: str,
) -> AttachCertificateToDistributionResultTypeDef:  # (1)
    ...
  1. See AttachCertificateToDistributionResultTypeDef
# attach_certificate_to_distribution method usage example with argument unpacking

kwargs: AttachCertificateToDistributionRequestRequestTypeDef = {  # (1)
    "distributionName": ...,
    "certificateName": ...,
}

parent.attach_certificate_to_distribution(**kwargs)
  1. See AttachCertificateToDistributionRequestRequestTypeDef

attach_disk#

Attaches a block storage disk to a running or stopped Lightsail instance and exposes it to the instance with the specified disk name.

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

# attach_disk method definition

def attach_disk(
    self,
    *,
    diskName: str,
    instanceName: str,
    diskPath: str,
    autoMounting: bool = ...,
) -> AttachDiskResultTypeDef:  # (1)
    ...
  1. See AttachDiskResultTypeDef
# attach_disk method usage example with argument unpacking

kwargs: AttachDiskRequestRequestTypeDef = {  # (1)
    "diskName": ...,
    "instanceName": ...,
    "diskPath": ...,
}

parent.attach_disk(**kwargs)
  1. See AttachDiskRequestRequestTypeDef

attach_instances_to_load_balancer#

Attaches one or more Lightsail instances to a load balancer.

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

# attach_instances_to_load_balancer me