SDK for PHP V3

Client: Aws\AppConfigCloudExtension\AppConfigCloudExtensionClient
Service ID: appconfigcloudextension
Version: 2024-10-09

This page describes the parameters and results for the operations of the AWS AppConfig Cloud Extension (2024-10-09), and shows how to use the Aws\AppConfigCloudExtension\AppConfigCloudExtensionClient object to call the described operations. This documentation is specific to the 2024-10-09 API version of the service.

Service Description

Serves AWS AppConfig configurations and feature flags from a local cache through the AWS Cloud Extensions runtime. By default, send requests to http://localhost:5333/appconfig.

Operation Summary

Each of the following operations can be created from a client using $client->getCommand('CommandName'), where "CommandName" is the name of one of the following operations. Note: a command is a value that encapsulates an operation and the parameters used to create an HTTP request.

You can also create and send a command immediately using the magic methods available on a client object: $client->commandName(/* parameters */). You can send the command asynchronously (returning a promise) by appending the word "Async" to the operation name: $client->commandNameAsync(/* parameters */).

GetConfiguration ( array $params = [] )
Returns the latest deployed configuration for an application, environment, and configuration profile, served from the Extension's local cache.
GetFlag ( array $params = [] )
Returns one flag of a feature flag configuration profile from the Extension's local cache.

Operations

GetConfiguration

$result = $client->getConfiguration([/* ... */]);
$promise = $client->getConfigurationAsync([/* ... */]);

Returns the latest deployed configuration for an application, environment, and configuration profile, served from the Extension's local cache. The Extension keeps the cache current by polling AWS AppConfig in the background, so repeated calls don't call AWS AppConfig.

Parameter Syntax

$result = $client->getConfiguration([
    'application' => '<string>', // REQUIRED
    'configuration' => '<string>', // REQUIRED
    'environment' => '<string>', // REQUIRED
]);

Parameter Details

Members
application
Required: Yes
Type: string

The name or ID of the AWS AppConfig application.

configuration
Required: Yes
Type: string

The name or ID of the AWS AppConfig configuration profile.

environment
Required: Yes
Type: string

The name or ID of the AWS AppConfig environment the configuration is deployed to.

Result Syntax

[
    'content' => <string || resource || Psr\Http\Message\StreamInterface>,
    'contentType' => '<string>',
    'revision' => '<string>',
    'versionLabel' => '<string>',
]

Result Details

Members
content
Required: Yes
Type: blob (string|resource|Psr\Http\Message\StreamInterface)

The deployed configuration's content. For a feature flag profile, the flags rendered as JSON without request context.

contentType
Required: Yes
Type: string

The content type of the deployed configuration, such as application/json.

revision
Required: Yes
Type: string

A value that changes whenever the served content changes. Compare it with an earlier value to detect a change.

versionLabel
Type: string

The label of the deployed configuration version, present only when the version has a label.

Errors

ValidationException:

The request does not fit the operation's model. The message describes every failure and may change; read reason and errors to act on them.

AccessDeniedException:

Access was denied. The reason says whether AWS Cloud Extensions couldn't authenticate the caller, or a service the Extension calls denied it.

ServiceUnavailableException:

AWS Cloud Extensions can't serve the request now. Retry it.

RequestEntityTooLargeException:

The request body is larger than AWS Cloud Extensions accepts.

BadGatewayException:

No usable answer came back: from the service AWS Cloud Extensions retrieves its profile from, from the Extension, or from a service the Extension calls. The reason says what to do, such as fixing the profile or role, checking the Extension's settings, or using an earlier version of the Extension.

ThrottlingException:

The call was throttled. Retry after the time Retry-After gives, when it is set. The reason says what throttled it.

UpgradeRequiredException:

The Extension needs a newer version of AWS Cloud Extensions. Upgrade it, or use an earlier version of the Extension.

InternalServerException:

An unexpected internal error occurred. Retry the request.

LoopDetectedException:

The request is part of a chain of calls that loops back through AWS Cloud Extensions.

GetFlag

$result = $client->getFlag([/* ... */]);
$promise = $client->getFlagAsync([/* ... */]);

Returns one flag of a feature flag configuration profile from the Extension's local cache. For a profile with variants, the flag's rules are evaluated locally against the request context.

Parameter Syntax

$result = $client->getFlag([
    'application' => '<string>', // REQUIRED
    'configuration' => '<string>', // REQUIRED
    'context' => ['<string>', ...],
    'environment' => '<string>', // REQUIRED
    'flag' => '<string>', // REQUIRED
]);

Parameter Details

Members
application
Required: Yes
Type: string

The name or ID of the AWS AppConfig application.

configuration
Required: Yes
Type: string

The name or ID of the feature flag configuration profile.

context
Type: Associative array of custom strings keys (RequestContextKey) to strings

The request context that the flag's variant rules are evaluated against.

environment
Required: Yes
Type: string

The name or ID of the AWS AppConfig environment the configuration is deployed to.

flag
Required: Yes
Type: string

The key of the flag to return.

Result Syntax

[
    'attributes' => [
        '<FlagAttributeKey>' => [
            'boolean' => true || false,
            'number' => <float>,
            'numberList' => [<float>, ...],
            'string' => '<string>',
            'stringList' => ['<string>', ...],
        ],
        // ...
    ],
    'enabled' => true || false,
    'variant' => '<string>',
]

Result Details

Members
attributes
Type: Associative array of custom strings keys (FlagAttributeKey) to FlagAttributeValue structures

The flag's attribute values, by attribute key, absent when the flag has none.

enabled
Required: Yes
Type: boolean

Whether the flag is enabled.

variant
Type: string

The name of the variant the request context matched, absent when the flag has no variants.

Errors

ValidationException:

The request does not fit the operation's model. The message describes every failure and may change; read reason and errors to act on them.

AccessDeniedException:

Access was denied. The reason says whether AWS Cloud Extensions couldn't authenticate the caller, or a service the Extension calls denied it.

ServiceUnavailableException:

AWS Cloud Extensions can't serve the request now. Retry it.

RequestEntityTooLargeException:

The request body is larger than AWS Cloud Extensions accepts.

BadGatewayException:

No usable answer came back: from the service AWS Cloud Extensions retrieves its profile from, from the Extension, or from a service the Extension calls. The reason says what to do, such as fixing the profile or role, checking the Extension's settings, or using an earlier version of the Extension.

ThrottlingException:

The call was throttled. Retry after the time Retry-After gives, when it is set. The reason says what throttled it.

UpgradeRequiredException:

The Extension needs a newer version of AWS Cloud Extensions. Upgrade it, or use an earlier version of the Extension.

InternalServerException:

An unexpected internal error occurred. Retry the request.

LoopDetectedException:

The request is part of a chain of calls that loops back through AWS Cloud Extensions.

Shapes

AccessDeniedException

Description

Access was denied. The reason says whether AWS Cloud Extensions couldn't authenticate the caller, or a service the Extension calls denied it.

Members
message
Required: Yes
Type: string

A description of the error.

reason
Required: Yes
Type: string

Why access was denied.

BadGatewayException

Description

No usable answer came back: from the service AWS Cloud Extensions retrieves its profile from, from the Extension, or from a service the Extension calls. The reason says what to do, such as fixing the profile or role, checking the Extension's settings, or using an earlier version of the Extension.

Members
extension
Type: string

The Extension the request is for, when the reason concerns one.

message
Required: Yes
Type: string

A description of the error.

reason
Required: Yes
Type: string

Why no usable answer came back, and so what to fix.

version
Type: string

The Extension's version, when the reason concerns one.

Constraint

Description

The constraint a value failed, named for the Smithy trait or rule that declares it, with what it allows.

Members
enum
Type: EnumConstraint structure

The value is not one of the enum's values.

length
Type: LengthConstraint structure

The value's length is outside @length.

pattern
Type: PatternConstraint structure

The value doesn't match @pattern.

range
Type: RangeConstraint structure

The value is outside @range.

required
Type: boolean

The member is @required and missing. Always true when set.

type
Type: TypeConstraint structure

The value is not the member's type.

union
Type: boolean

The union sets no member or more than one. Always true when set.

EnumConstraint

Description

The value is not one of the allowed values.

Members
allowed
Required: Yes
Type: Array of strings

The values allowed.

FieldConstraint

Description

A member whose value failed one of its constraints.

Members
constraint
Required: Yes
Type: Constraint structure

The constraint the value failed.

field
Required: Yes
Type: string

The member's path from the input: a.b for a nested member, a[0] for a list element, a[key] for a map value.

value
Type: string

The value as sent. It is omitted for a missing member, a length or union failure, and a @sensitive member.

FlagAttributeValue

Description

A flag attribute value. Exactly one member is set, according to the attribute's type.

Members
boolean
Type: boolean

A boolean attribute value.

number
Type: double

A number attribute value.

numberList
Type: Array of doubles

A list of numbers attribute value.

string
Type: string

A string attribute value.

stringList
Type: Array of strings

A list of strings attribute value.

InternalServerException

Description

An unexpected internal error occurred. Retry the request.

Members
message
Required: Yes
Type: string

A description of the error.

LengthConstraint

Description

The value's length is outside the allowed range.

Members
max
Type: long (int|float)

The longest length allowed.

min
Type: long (int|float)

The shortest length allowed.

tested
Required: Yes
Type: long (int|float)

The value's length.

LoopDetectedException

Description

The request is part of a chain of calls that loops back through AWS Cloud Extensions.

Members
message
Required: Yes
Type: string

A description of the error.

PatternConstraint

Description

The value doesn't match the required pattern.

Members
pattern
Required: Yes
Type: string

The pattern the value must match.

RangeConstraint

Description

The value is outside the allowed range.

Members
max
Type: double

The largest value allowed.

min
Type: double

The smallest value allowed.

RequestEntityTooLargeException

Description

The request body is larger than AWS Cloud Extensions accepts.

Members
message
Required: Yes
Type: string

A description of the error.

SemanticError

Description

A request the Extension refused for a reason of its own, named by problem.

Members
item
Type: string

The member or item the problem concerns.

problem
Required: Yes
Type: string

An UPPER_SNAKE code for what was wrong.

value
Type: string

The value the problem concerns.

ServiceUnavailableException

Description

AWS Cloud Extensions can't serve the request now. Retry it.

Members
extension
Type: string

The Extension the request is for, when the reason concerns one.

message
Required: Yes
Type: string

A description of the error.

reason
Required: Yes
Type: string

Why the request can't be served now.

ThrottlingException

Description

The call was throttled. Retry after the time Retry-After gives, when it is set. The reason says what throttled it.

Members
extension
Required: Yes
Type: string

The Extension the call is for.

message
Required: Yes
Type: string

A description of the error.

reason
Required: Yes
Type: string

What throttled the call.

retryAfterSeconds
Type: int

Not set by AWS SDK clients: AWS Cloud Extensions sends the retry delay, in seconds, only in the Retry-After response header.

TypeConstraint

Description

The value is not of the member's type.

Members
expected
Required: Yes
Type: string

The Smithy type the value must have, such as integer or timestamp.

UpgradeRequiredException

Description

The Extension needs a newer version of AWS Cloud Extensions. Upgrade it, or use an earlier version of the Extension.

Members
extension
Required: Yes
Type: string

The Extension the request is for.

message
Required: Yes
Type: string

A description of the error.

reason
Required: Yes
Type: string

What needs the newer version.

version
Required: Yes
Type: string

The Extension's version.

ValidationError

Description

One validation failure: either a constraint a member failed, or a semantic error.

Members
fieldConstraint
Type: FieldConstraint structure

A member's value failed a constraint the model declares.

semanticError
Type: SemanticError structure

A request the Extension refused for a reason of its own.

ValidationException

Description

The request does not fit the operation's model. The message describes every failure and may change; read reason and errors to act on them.

Members
errors
Type: Array of ValidationError structures

The failures, when reason is FIELD_VALIDATION_FAILED. A configuration or flag that doesn't exist is a semanticError with problem RESOURCE_NOT_FOUND or FLAG_NOT_FOUND.

message
Required: Yes
Type: string

A description of the error.

reason
Required: Yes
Type: string

Why the request is invalid.