ApiCallBase

class aws_cdk.integ_tests_alpha.ApiCallBase(scope, id)

Bases: Construct

(experimental) Base class for an ApiCall.

Stability:

experimental

Parameters:
Stability:

experimental

Methods

abstract assert_at_path(path, expected)

(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.

Providing a path will filter the output of the initial API call.

For example the SQS.receiveMessage api response would look like:

If you wanted to assert the value of Body you could do

Parameters:
Stability:

experimental

Return type:

IApiCall

expect(expected)

(experimental) Assert that the ExpectedResult is equal to the result of the AwsApiCall.

Parameters:

expected (ExpectedResult) –

Stability:

experimental

Return type:

IApiCall

get_att(attribute_name)

(experimental) Returns the value of an attribute of the custom resource of an arbitrary type.

Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.

Parameters:

attribute_name (str) –

Stability:

experimental

Return type:

Reference

get_att_string(attribute_name)

(experimental) Returns the value of an attribute of the custom resource of type string.

Attributes are returned from the custom resource provider through the Data map where the key is the attribute name.

Parameters:

attribute_name (str) –

Stability:

experimental

Return type:

str

next(next)

(experimental) Allows you to chain IApiCalls. This adds an explicit dependency betweent the two resources.

Returns the IApiCall provided as next

Parameters:

next (IApiCall) –

Stability:

experimental

Return type:

IApiCall

to_string()

Returns a string representation of this construct.

Return type:

str

abstract wait_for_assertions(*, backoff_rate=None, interval=None, total_timeout=None)

(experimental) Wait for the IApiCall to return the expected response.

If no expected response is specified then it will wait for the IApiCall to return a success

Parameters:
  • backoff_rate (Union[int, float, None]) – (experimental) Backoff between attempts. This is the multiplier by which the retry interval increases after each retry attempt. By default there is no backoff. Each retry will wait the amount of time specified by interval. Default: 1 (no backoff)

  • interval (Optional[Duration]) – (experimental) The interval (number of seconds) to wait between attempts. Default: Duration.seconds(5)

  • total_timeout (Optional[Duration]) – (experimental) The total time that the state machine will wait for a successful response. Default: Duration.minutes(30)

Stability:

experimental

Return type:

IApiCall

Attributes

node

The tree node.

provider

(experimental) access the AssertionsProvider.

This can be used to add additional IAM policies the the provider role policy

Stability:

experimental

Static Methods

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.