Set the default version of a document.
If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the apply-only-at-cron-interval parameter.
Parameters:
-
name
(DocumentName)
–
The name of a custom document that you want to set as the default version.
-
document_version
(DocumentVersionNumber)
–
The version of a custom document that you want to set as the default version.
Raises:
Source code in docs_src/capo_ssm/_services/ssm.py
| def update_document_default_version(
self,
name: "capo_ssm.types.document_name.DocumentName",
document_version: "capo_ssm.types.document_version_number.DocumentVersionNumber",
*,
config_overrides: Optional[SSMClientConfig] = None,
) -> "capo_ssm.types.update_document_default_version_result.UpdateDocumentDefaultVersionResult":
"""<p>Set the default version of a document. </p> <note> <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p> </note>
Args:
name: <p>The name of a custom document that you want to set as the default version.</p>
document_version: <p>The version of a custom document that you want to set as the default version.</p>
Raises:
capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
capo_ssm.errors.invalid_document.InvalidDocument: <p>The specified SSM document doesn't exist.</p>
capo_ssm.errors.invalid_document_schema_version.InvalidDocumentSchemaVersion: <p>The version of the document schema isn't supported.</p>
capo_ssm.errors.invalid_document_version.InvalidDocumentVersion: <p>The document version isn't valid or doesn't exist.</p>
capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_ssm.types.update_document_default_version_request.UpdateDocumentDefaultVersionRequest]",
) -> OperationResponse[
"capo_ssm.types.update_document_default_version_result.UpdateDocumentDefaultVersionResult"
]:
import capo_ssm._operations.amazon_ssm.update_document_default_version
output, http_response = (
capo_ssm._operations.amazon_ssm.update_document_default_version.update_document_default_version(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateDocumentDefaultVersion")
)
input_: capo_ssm.types.update_document_default_version_request.UpdateDocumentDefaultVersionRequest = {
"name": name,
"document_version": document_version,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|