Updates an HTTP namespace.
Parameters:
-
id
(Arn)
–
The ID or Amazon Resource Name (ARN) of the namespace that you want to update.
-
updater_request_id
(Optional[ResourceId], default:
None
)
–
A unique string that identifies the request and that allows failed UpdateHttpNamespace requests to be retried without the risk of running the operation twice. UpdaterRequestId can be any unique string (for example, a date/timestamp).
-
namespace
(HttpNamespaceChange)
–
Updated properties for the the HTTP namespace.
Raises:
-
DuplicateRequest
–
The operation is already in progress.
-
InvalidInput
–
One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.
-
NamespaceNotFound
–
No namespace exists with the specified ID.
-
ResourceInUse
–
The specified resource can't be deleted because it contains other resources. For example, you can't delete a service that contains any instances.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To update a HTTP namespace
The following example updates the description of a HTTP namespace.
>>> client.update_http_namespace(id='ns-vh4nbmEXAMPLE', namespace={'Description': 'The updated namespace description.'})
Update HTTP namespace using namespace ARN for shared namespace
This example updates an HTTP namespace using a namespace ARN instead of namespace ID.
>>> client.update_http_namespace(id='arn:aws:servicediscovery:us-west-2:123456789012:namespace/ns-vh4nbmexample', namespace={'Description': 'Updated description for shared HTTP namespace.'})
Source code in docs_src/capo_servicediscovery/_services/service_discovery.py
| def update_http_namespace(
self,
id: "capo_servicediscovery.types.arn.Arn",
namespace: "capo_servicediscovery.types.http_namespace_change.HttpNamespaceChange",
*,
config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
updater_request_id: Optional[
"capo_servicediscovery.types.resource_id.ResourceId"
] = None,
) -> "capo_servicediscovery.types.update_http_namespace_response.UpdateHttpNamespaceResponse":
"""<p>Updates an HTTP namespace.</p>
Args:
id: <p>The ID or Amazon Resource Name (ARN) of the namespace that you want to update.</p>
updater_request_id: <p>A unique string that identifies the request and that allows failed <code>UpdateHttpNamespace</code> requests to be retried without the risk of running the operation twice. <code>UpdaterRequestId</code> can be any unique string (for example, a date/timestamp).</p>
namespace: <p>Updated properties for the the HTTP namespace.</p>
Raises:
capo_servicediscovery.errors.duplicate_request.DuplicateRequest: <p>The operation is already in progress.</p>
capo_servicediscovery.errors.invalid_input.InvalidInput: <p>One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.</p>
capo_servicediscovery.errors.namespace_not_found.NamespaceNotFound: <p>No namespace exists with the specified ID.</p>
capo_servicediscovery.errors.resource_in_use.ResourceInUse: <p>The specified resource can't be deleted because it contains other resources. For example, you can't delete a service that contains any instances.</p>
capo_servicediscovery.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To update a HTTP namespace
The following example updates the description of a HTTP namespace.
>>> client.update_http_namespace(id='ns-vh4nbmEXAMPLE', namespace={'Description': 'The updated namespace description.'})
Update HTTP namespace using namespace ARN for shared namespace
This example updates an HTTP namespace using a namespace ARN instead of namespace ID.
>>> client.update_http_namespace(id='arn:aws:servicediscovery:us-west-2:123456789012:namespace/ns-vh4nbmexample', namespace={'Description': 'Updated description for shared HTTP namespace.'})
"""
def _handler(
req: "OperationRequest[capo_servicediscovery.types.update_http_namespace_request.UpdateHttpNamespaceRequest]",
) -> OperationResponse[
"capo_servicediscovery.types.update_http_namespace_response.UpdateHttpNamespaceResponse"
]:
import capo_servicediscovery._operations.route53_auto_naming_v20170314.update_http_namespace
output, http_response = (
capo_servicediscovery._operations.route53_auto_naming_v20170314.update_http_namespace.update_http_namespace(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateHttpNamespace")
)
input_: capo_servicediscovery.types.update_http_namespace_request.UpdateHttpNamespaceRequest = {
"id": id,
"namespace": namespace,
}
if updater_request_id is None:
updater_request_id = str(uuid.uuid4())
input_["updater_request_id"] = updater_request_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|