Archives specific Source Servers by setting the SourceServer.isArchived property to true for specified SourceServers by ID. This command only works for SourceServers with a lifecycle state that equals DISCONNECTED or CUTOVER.
Parameters:
-
source_server_id
(SourceServerID)
–
Mark as archived by Source Server ID.
-
account_id
(Optional[AccountID], default:
None
)
–
Mark as archived by Account ID.
Raises:
Source code in docs_src/capo_mgn/_services/async_mgn.py
| async def mark_as_archived(
self,
source_server_id: "capo_mgn.types.source_server_id.SourceServerID",
*,
config_overrides: Optional[AsyncmgnClientConfig] = None,
account_id: Optional["capo_mgn.types.account_id.AccountID"] = None,
) -> "capo_mgn.types.source_server.SourceServer":
"""<p>Archives specific Source Servers by setting the SourceServer.isArchived property to true for specified SourceServers by ID. This command only works for SourceServers with a lifecycle state that equals DISCONNECTED or CUTOVER.</p>
Args:
source_server_id: <p>Mark as archived by Source Server ID.</p>
account_id: <p>Mark as archived by Account ID.</p>
Raises:
capo_mgn.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the target resource.</p>
capo_mgn.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found exception.</p>
capo_mgn.errors.uninitialized_account_exception.UninitializedAccountException: <p>Uninitialized account exception.</p>
capo_mgn.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_mgn.types.mark_as_archived_request.MarkAsArchivedRequest]",
) -> AsyncOperationResponse["capo_mgn.types.source_server.SourceServer"]:
import capo_mgn._operations.application_migration_service.mark_as_archived
(
output,
http_response,
) = await capo_mgn._operations.application_migration_service.mark_as_archived.async_mark_as_archived(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_mgn.types.source_server.SourceServer",
) -> dict[str, Any]:
import capo_mgn.types.source_server
return capo_mgn.types.source_server.redact_sensitive(output)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("MarkAsArchived", redact_output=_redact_output),
)
input_: capo_mgn.types.mark_as_archived_request.MarkAsArchivedRequest = {
"source_server_id": source_server_id
}
if account_id is not None:
input_["account_id"] = account_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|