This operation initiates a job of the specified type, which can be a select, an archival retrieval, or a vault retrieval. For more information about using this operation, see the documentation for the underlying REST API Initiate a Job.
Parameters:
-
account_id
(string)
–
The AccountId value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.
-
vault_name
(string)
–
-
job_parameters
(Optional[JobParameters], default:
None
)
–
Provides options for specifying job information.
Raises:
-
InsufficientCapacityException
–
Returned if there is insufficient capacity to process this expedited request. This error only applies to expedited retrievals and not to standard or bulk retrievals.
-
InvalidParameterValueException
–
Returned if a parameter of the request is incorrectly specified.
-
MissingParameterValueException
–
Returned if a required header or parameter is missing from the request.
-
NoLongerSupportedException
–
Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.
-
PolicyEnforcedException
–
Returned if a retrieval job would exceed the current data policy's retrieval rate limit. For more information about data retrieval policies,
-
ResourceNotFoundException
–
Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist.
-
ServiceUnavailableException
–
Returned if the service cannot complete the request.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To initiate an inventory-retrieval job
The example initiates an inventory-retrieval job for the vault named examplevault.
>>> client.initiate_job(account_id='-', vault_name='examplevault', job_parameters={'Type': 'inventory-retrieval', 'Description': 'My inventory job', 'Format': 'CSV', 'SNSTopic': 'arn:aws:sns:us-west-2:111111111111:Glacier-InventoryRetrieval-topic-Example'})
Source code in docs_src/capo_glacier/_services/glacier.py
| def initiate_job(
self,
account_id: "capo_glacier.types.string.string",
vault_name: "capo_glacier.types.string.string",
*,
config_overrides: Optional[GlacierClientConfig] = None,
job_parameters: Optional[
"capo_glacier.types.job_parameters.JobParameters"
] = None,
) -> "capo_glacier.types.initiate_job_output.InitiateJobOutput":
"""<p>This operation initiates a job of the specified type, which can be a select, an archival retrieval, or a vault retrieval. For more information about using this operation, see the documentation for the underlying REST API <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html">Initiate a Job</a>. </p>
Args:
account_id: <p>The <code>AccountId</code> value is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '<code>-</code>' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID.</p>
vault_name: <p>The name of the vault.</p>
job_parameters: <p>Provides options for specifying job information.</p>
Raises:
capo_glacier.errors.insufficient_capacity_exception.InsufficientCapacityException: <p>Returned if there is insufficient capacity to process this expedited request. This error only applies to expedited retrievals and not to standard or bulk retrievals.</p>
capo_glacier.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Returned if a parameter of the request is incorrectly specified.</p>
capo_glacier.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Returned if a required header or parameter is missing from the request.</p>
capo_glacier.errors.no_longer_supported_exception.NoLongerSupportedException: <p>Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.</p>
capo_glacier.errors.policy_enforced_exception.PolicyEnforcedException: <p>Returned if a retrieval job would exceed the current data policy's retrieval rate limit. For more information about data retrieval policies,</p>
capo_glacier.errors.resource_not_found_exception.ResourceNotFoundException: <p>Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist.</p>
capo_glacier.errors.service_unavailable_exception.ServiceUnavailableException: <p>Returned if the service cannot complete the request.</p>
capo_glacier.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To initiate an inventory-retrieval job
The example initiates an inventory-retrieval job for the vault named examplevault.
>>> client.initiate_job(account_id='-', vault_name='examplevault', job_parameters={'Type': 'inventory-retrieval', 'Description': 'My inventory job', 'Format': 'CSV', 'SNSTopic': 'arn:aws:sns:us-west-2:111111111111:Glacier-InventoryRetrieval-topic-Example'})
"""
def _handler(
req: "OperationRequest[capo_glacier.types.initiate_job_input.InitiateJobInput]",
) -> OperationResponse[
"capo_glacier.types.initiate_job_output.InitiateJobOutput"
]:
import capo_glacier._operations.glacier.initiate_job
output, http_response = (
capo_glacier._operations.glacier.initiate_job.initiate_job(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("InitiateJob")
)
input_: capo_glacier.types.initiate_job_input.InitiateJobInput = {
"account_id": account_id,
"vault_name": vault_name,
}
if job_parameters is not None:
input_["job_parameters"] = job_parameters
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|