Creates an Amazon OpenSearch Service-managed VPC endpoint.
Parameters:
-
domain_arn
(DomainArn)
–
The Amazon Resource Name (ARN) of the domain to grant access to.
-
vpc_options
(VPCOptions)
–
Options to specify the subnets and security groups for the endpoint.
-
client_token
(Optional[ClientToken], default:
None
)
–
Unique, case-sensitive identifier to ensure idempotency of the request.
Raises:
-
BaseException
–
An error occurred while processing the request.
-
ConflictException
–
An error occurred because the client attempts to remove a resource that is currently in use. Returns HTTP status code 409.
-
DisabledOperationException
–
An error occured because the client wanted to access a not supported operation. Gives http status code of 409.
-
InternalException
–
The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.
-
LimitExceededException
–
An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.
-
ValidationException
–
An exception for missing / invalid input fields. Gives http status code of 400.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_elasticsearch_service/_services/elasticsearch_service.py
| def create_vpc_endpoint(
self,
domain_arn: "capo_elasticsearch_service.types.domain_arn.DomainArn",
vpc_options: "capo_elasticsearch_service.types.vpc_options.VPCOptions",
*,
config_overrides: Optional[ElasticsearchServiceClientConfig] = None,
client_token: Optional[
"capo_elasticsearch_service.types.client_token.ClientToken"
] = None,
) -> "capo_elasticsearch_service.types.create_vpc_endpoint_response.CreateVpcEndpointResponse":
"""<p>Creates an Amazon OpenSearch Service-managed VPC endpoint.</p>
Args:
domain_arn: <p>The Amazon Resource Name (ARN) of the domain to grant access to.</p>
vpc_options: <p>Options to specify the subnets and security groups for the endpoint.</p>
client_token: <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
Raises:
capo_elasticsearch_service.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
capo_elasticsearch_service.errors.conflict_exception.ConflictException: <p>An error occurred because the client attempts to remove a resource that is currently in use. Returns HTTP status code 409.</p>
capo_elasticsearch_service.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access a not supported operation. Gives http status code of 409.</p>
capo_elasticsearch_service.errors.internal_exception.InternalException: <p>The request processing has failed because of an unknown error, exception or failure (the failure is internal to the service) . Gives http status code of 500.</p>
capo_elasticsearch_service.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than allowed resources or sub-resources. Gives http status code of 409.</p>
capo_elasticsearch_service.errors.validation_exception.ValidationException: <p>An exception for missing / invalid input fields. Gives http status code of 400.</p>
capo_elasticsearch_service.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_elasticsearch_service.types.create_vpc_endpoint_request.CreateVpcEndpointRequest]",
) -> OperationResponse[
"capo_elasticsearch_service.types.create_vpc_endpoint_response.CreateVpcEndpointResponse"
]:
import capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.create_vpc_endpoint
output, http_response = (
capo_elasticsearch_service._operations.amazon_elasticsearch_service2015.create_vpc_endpoint.create_vpc_endpoint(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateVpcEndpoint")
)
input_: capo_elasticsearch_service.types.create_vpc_endpoint_request.CreateVpcEndpointRequest = {
"domain_arn": domain_arn,
"vpc_options": vpc_options,
}
if client_token is not None:
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|