MigrationHubConfig

Client

class MigrationHubConfig.Client

A low-level client representing AWS Migration Hub Config:

client = session.create_client('migrationhub-config')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
create_home_region_control(**kwargs)

This API sets up the home region for the calling account only.

See also: AWS API Documentation

Request Syntax

response = client.create_home_region_control(
    HomeRegion='string',
    Target={
        'Type': 'ACCOUNT',
        'Id': 'string'
    },
    DryRun=True|False
)
Parameters
  • HomeRegion (string) --

    [REQUIRED]

    The name of the home region of the calling account.

  • Target (dict) --

    [REQUIRED]

    The account for which this command sets up a home region control. The Target is always of type ACCOUNT .

    • Type (string) -- [REQUIRED]

      The target type is always an ACCOUNT .

    • Id (string) --

      The TargetID is a 12-character identifier of the ACCOUNT for which the control was created. (This must be the current account.)

  • DryRun (boolean) -- Optional Boolean flag to indicate whether any effect should take place. It tests whether the caller has permission to make the call.
Return type

dict

Returns

Response Syntax

{
    'HomeRegionControl': {
        'ControlId': 'string',
        'HomeRegion': 'string',
        'Target': {
            'Type': 'ACCOUNT',
            'Id': 'string'
        },
        'RequestedTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • HomeRegionControl (dict) --

      This object is the HomeRegionControl object that's returned by a successful call to CreateHomeRegionControl .

      • ControlId (string) --

        A unique identifier that's generated for each home region control. It's always a string that begins with "hrc-" followed by 12 lowercase letters and numbers.

      • HomeRegion (string) --

        The AWS Region that's been set as home region. For example, "us-west-2" or "eu-central-1" are valid home regions.

      • Target (dict) --

        The target parameter specifies the identifier to which the home region is applied, which is always an ACCOUNT . It applies the home region to the current ACCOUNT .

        • Type (string) --

          The target type is always an ACCOUNT .

        • Id (string) --

          The TargetID is a 12-character identifier of the ACCOUNT for which the control was created. (This must be the current account.)

      • RequestedTime (datetime) --

        A timestamp representing the time when the customer called CreateHomeregionControl and set the home region for the account.

Exceptions

describe_home_region_controls(**kwargs)

This API permits filtering on the ControlId and HomeRegion fields.

See also: AWS API Documentation

Request Syntax

response = client.describe_home_region_controls(
    ControlId='string',
    HomeRegion='string',
    Target={
        'Type': 'ACCOUNT',
        'Id': 'string'
    },
    MaxResults=123,
    NextToken='string'
)
Parameters
  • ControlId (string) -- The ControlID is a unique identifier string of your HomeRegionControl object.
  • HomeRegion (string) -- The name of the home region you'd like to view.
  • Target (dict) --

    The target parameter specifies the identifier to which the home region is applied, which is always of type ACCOUNT . It applies the home region to the current ACCOUNT .

    • Type (string) -- [REQUIRED]

      The target type is always an ACCOUNT .

    • Id (string) --

      The TargetID is a 12-character identifier of the ACCOUNT for which the control was created. (This must be the current account.)

  • MaxResults (integer) -- The maximum number of filtering results to display per page.
  • NextToken (string) -- If a NextToken was returned by a previous call, more results are available. To retrieve the next page of results, make the call again using the returned token in NextToken .
Return type

dict

Returns

Response Syntax

{
    'HomeRegionControls': [
        {
            'ControlId': 'string',
            'HomeRegion': 'string',
            'Target': {
                'Type': 'ACCOUNT',
                'Id': 'string'
            },
            'RequestedTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • HomeRegionControls (list) --

      An array that contains your HomeRegionControl objects.

      • (dict) --

        A home region control is an object that specifies the home region for an account, with some additional information. It contains a target (always of type ACCOUNT ), an ID, and a time at which the home region was set.

        • ControlId (string) --

          A unique identifier that's generated for each home region control. It's always a string that begins with "hrc-" followed by 12 lowercase letters and numbers.

        • HomeRegion (string) --

          The AWS Region that's been set as home region. For example, "us-west-2" or "eu-central-1" are valid home regions.

        • Target (dict) --

          The target parameter specifies the identifier to which the home region is applied, which is always an ACCOUNT . It applies the home region to the current ACCOUNT .

          • Type (string) --

            The target type is always an ACCOUNT .

          • Id (string) --

            The TargetID is a 12-character identifier of the ACCOUNT for which the control was created. (This must be the current account.)

        • RequestedTime (datetime) --

          A timestamp representing the time when the customer called CreateHomeregionControl and set the home region for the account.

    • NextToken (string) --

      If a NextToken was returned by a previous call, more results are available. To retrieve the next page of results, make the call again using the returned token in NextToken .

Exceptions

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_home_region()

Returns the calling account’s home region, if configured. This API is used by other AWS services to determine the regional endpoint for calling AWS Application Discovery Service and Migration Hub. You must call GetHomeRegion at least once before you call any other AWS Application Discovery Service and AWS Migration Hub APIs, to obtain the account's Migration Hub home region.

See also: AWS API Documentation

Request Syntax

response = client.get_home_region()
Return type
dict
Returns
Response Syntax
{
    'HomeRegion': 'string'
}

Response Structure

  • (dict) --
    • HomeRegion (string) --

      The name of the home region of the calling account.

Exceptions

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter

Client Exceptions

Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.

The available client exceptions are:

class MigrationHubConfig.Client.exceptions.AccessDeniedException

You do not have sufficient access to perform this action.

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    You do not have sufficient access to perform this action.

    • Message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class MigrationHubConfig.Client.exceptions.DryRunOperation

Exception raised to indicate that authorization of an action was successful, when the DryRun flag is set to true.

Example

try:
  ...
except client.exceptions.DryRunOperation as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Exception raised to indicate that authorization of an action was successful, when the DryRun flag is set to true.

    • Message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class MigrationHubConfig.Client.exceptions.InternalServerError

Exception raised when an internal, configuration, or dependency error is encountered.

Example

try:
  ...
except client.exceptions.InternalServerError as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Exception raised when an internal, configuration, or dependency error is encountered.

    • Message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class MigrationHubConfig.Client.exceptions.InvalidInputException

Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.

Example

try:
  ...
except client.exceptions.InvalidInputException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.

    • Message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class MigrationHubConfig.Client.exceptions.ServiceUnavailableException

Exception raised when a request fails due to temporary unavailability of the service.

Example

try:
  ...
except client.exceptions.ServiceUnavailableException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    Exception raised when a request fails due to temporary unavailability of the service.

    • Message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class MigrationHubConfig.Client.exceptions.ThrottlingException

The request was denied due to request throttling.

Example

try:
  ...
except client.exceptions.ThrottlingException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'Message': 'string',
    'RetryAfterSeconds': 123,
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The request was denied due to request throttling.

    • Message (string) --

    • RetryAfterSeconds (integer) --

      The number of seconds the caller should wait before retrying.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.

Paginators

The available paginators are: