Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

get_instance_state

get_instance_state(**kwargs)

Returns the state of a specific instance. Works on one instance at a time.

See also: AWS API Documentation

Request Syntax

response = client.get_instance_state(
    instanceName='string'
)
Parameters
instanceName (string) --

[REQUIRED]

The name of the instance to get state information about.

Return type
dict
Returns
Response Syntax
{
    'state': {
        'code': 123,
        'name': 'string'
    }
}

Response Structure

  • (dict) --
    • state (dict) --

      The state of the instance.

      • code (integer) --

        The status code for the instance.

      • name (string) --

        The state of the instance (e.g., running or pending ).

Exceptions

  • Lightsail.Client.exceptions.ServiceException
  • Lightsail.Client.exceptions.InvalidInputException
  • Lightsail.Client.exceptions.NotFoundException
  • Lightsail.Client.exceptions.OperationFailureException
  • Lightsail.Client.exceptions.AccessDeniedException
  • Lightsail.Client.exceptions.AccountSetupInProgressException
  • Lightsail.Client.exceptions.UnauthenticatedException