Skip to content

get_flag

get_flag(
    application: Identifier,
    environment: Identifier,
    configuration: ConfigurationIdentifier,
    flag: FlagKey,
    *,
    config_overrides: Optional[AppConfigCloudExtensionClientConfig] = None,
    context: Optional[RequestContext] = None,
) -> GetFlagResponse

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.

Parameters:

  • application (Identifier) –

    The name or ID of the AWS AppConfig application.

  • environment (Identifier) –

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

  • configuration (ConfigurationIdentifier) –

    The name or ID of the feature flag configuration profile.

  • flag (FlagKey) –

    The key of the flag to return.

  • context (Optional[RequestContext], default: None ) –

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

Raises:

  • AccessDeniedException –

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

  • 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.

  • 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.

  • RequestEntityTooLargeException –

    The request body is larger than AWS Cloud Extensions accepts.

  • ServiceUnavailableException –

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

  • 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.

  • 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.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_appconfigcloudextension/_services/app_config_cloud_extension.py
def get_flag(
    self,
    application: "capo_appconfigcloudextension.types.identifier.Identifier",
    environment: "capo_appconfigcloudextension.types.identifier.Identifier",
    configuration: "capo_appconfigcloudextension.types.configuration_identifier.ConfigurationIdentifier",
    flag: "capo_appconfigcloudextension.types.flag_key.FlagKey",
    *,
    config_overrides: Optional[AppConfigCloudExtensionClientConfig] = None,
    context: Optional[
        "capo_appconfigcloudextension.types.request_context.RequestContext"
    ] = None,
) -> "capo_appconfigcloudextension.types.get_flag_response.GetFlagResponse":
    """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.

    Args:
        application: The name or ID of the AWS AppConfig application.
        environment: The name or ID of the AWS AppConfig environment the configuration is deployed to.
        configuration: The name or ID of the feature flag configuration profile.
        flag: The key of the flag to return.
        context: The request context that the flag's variant rules are evaluated against.

    Raises:
        capo_appconfigcloudextension.errors.access_denied_exception.AccessDeniedException: Access was denied. The reason says whether AWS Cloud Extensions couldn't authenticate the caller, or a service the Extension calls denied it.
        capo_appconfigcloudextension.errors.bad_gateway_exception.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.
        capo_appconfigcloudextension.errors.internal_server_exception.InternalServerException: An unexpected internal error occurred. Retry the request.
        capo_appconfigcloudextension.errors.loop_detected_exception.LoopDetectedException: The request is part of a chain of calls that loops back through AWS Cloud Extensions.
        capo_appconfigcloudextension.errors.request_entity_too_large_exception.RequestEntityTooLargeException: The request body is larger than AWS Cloud Extensions accepts.
        capo_appconfigcloudextension.errors.service_unavailable_exception.ServiceUnavailableException: AWS Cloud Extensions can't serve the request now. Retry it.
        capo_appconfigcloudextension.errors.throttling_exception.ThrottlingException: The call was throttled. Retry after the time Retry-After gives, when it is set. The reason says what throttled it.
        capo_appconfigcloudextension.errors.upgrade_required_exception.UpgradeRequiredException: The Extension needs a newer version of AWS Cloud Extensions. Upgrade it, or use an earlier version of the Extension.
        capo_appconfigcloudextension.errors.validation_exception.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.
        capo_appconfigcloudextension.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_appconfigcloudextension.types.get_flag_request.GetFlagRequest]",
    ) -> OperationResponse[
        "capo_appconfigcloudextension.types.get_flag_response.GetFlagResponse"
    ]:
        import capo_appconfigcloudextension._operations.app_config.get_flag

        output, http_response = (
            capo_appconfigcloudextension._operations.app_config.get_flag.get_flag(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetFlag")
    )
    input_: capo_appconfigcloudextension.types.get_flag_request.GetFlagRequest = {
        "application": application,
        "environment": environment,
        "configuration": configuration,
        "flag": flag,
    }
    if context is not None:
        input_["context"] = context

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output