CreateJob

Last updated: 2020-12-16 14:21:34

    Feature description

    This API is used to create a batch operation job in a bucket. For more information, please see Batch Operation Overview.

    When calling this API, make sure you have permission to perform operations on the objects in the bucket. The bucket owner has permission by default and can grant such permission to other users. Please apply for permission from the bucket owner if you do not have it.

    Request

    Sample request

    POST /jobs HTTP/1.1
    Host: <UIN>.cos-control.<Region>.myqcloud.com
    Date: GMT Date
    Content-Type: application/xml
    Content-Length: Content Length
    Authorization: Auth String
    x-cos-appid: <appid>
    
    <?xml version="1.0" encoding="UTF-8" ?>
    <CreateJobRequest>
    ...
    </CreateJobRequest>

    Note:

    Authorization: Auth String (see Request Signature for details).

    Request Parameters

    Calling the CreateJob API requires the following parameters:

    Parameter Description Required
    x-cos-appid User APPID with a length of 1–64 bytes. Yes

    Request Headers

    This API only uses common request headers. For more information, see Common Request Headers.

    Request Body

    You can set the configuration for the inventory job in the request body by using the XML markup language. This information includes objects to be analyzed by the inventory job, the frequency and dimension of the analysis, and the format and storage location of the analysis result.

    <CreateJobRequest>
        <ClientRequestToken>string</ClientRequestToken>
        <ConfirmationRequired>boolean</ConfirmationRequired>
        <Description>string</Description>
        <Manifest>
            <Location>
                <ETag>string</ETag>
                <ObjectArn>string</ObjectArn>
                <ObjectVersionId>string</ObjectVersionId>
            </Location>
            <Spec>
                <Fields>
                    <member>string</member>
                    <member>string</member>
                </Fields>
                <Format>string</Format>
            </Spec>
        </Manifest>
        <Operation>
            <COSInitiateRestoreObject>   
                <ExpirationInDays> integer </ExpirationInDays>
                <JobTier> string </JobTier>
            </COSInitiateRestoreObject>
            <COSPutObjectCopy> 
                <AccessControlDirective>string</AccessControlDirective>
                <AccessControlGrants>
                    <COSGrant>
                        <Grantee>
                            <Identifier>string</Identifier>
                            <TypeIdentifier>string</TypeIdentifier>
                        </Grantee>
                        <Permission>string</Permission>
                    </COSGrant>
                    <COSGrant>
                        <Grantee>
                            <Identifier>string</Identifier>
                            <TypeIdentifier>string</TypeIdentifier>
                        </Grantee>
                        <Permission>string</Permission>
                    </COSGrant>
                </AccessControlGrants>
                <PrefixReplace>boolean</PrefixReplace>
                <ResourcesPrefix>string</ResourcesPrefix>
                <TargetKeyPrefix>string</TargetKeyPrefix>
                <CannedAccessControlList>string</CannedAccessControlList>
                <MetadataDirective>string</MetadataDirective>
                <ModifiedSinceConstraint>timestamp</ModifiedSinceConstraint>
                <UnModifiedSinceConstraint>timestamp</UnModifiedSinceConstraint>
                <MetadataDirective>string</MetadataDirective>
                <NewObjectMetadata>
                    <CacheControl>string</CacheControl>
                    <ContentDisposition>string</ContentDisposition>
                    <ContentEncoding>string</ContentEncoding>
                    <ContentType>string</ContentType>
                    <HttpExpiresDate>timestamp</HttpExpiresDate>
                    <SSEAlgorithm>string</SSEAlgorithm>
                    <UserMetadata>
                        <member>
                            <Key>string</Key>
                            <Value>string</Value>
                        </member>
                        <member>
                            <Key>string</Key>
                            <Value>string</Value>
                        </member>
                    </UserMetadata>
                </NewObjectMetadata>
                <TaggingDirective>string</TaggingDirective>
                <NewObjectTagging>
                    <COSTag>
                        <Key>string</Key>