Skip to content

Latest commit

 

History

History
337 lines (213 loc) · 3.62 KB

File metadata and controls

337 lines (213 loc) · 3.62 KB

Create Clone

Create a clone job.

URI: /sap/opu/odata/sap/MANAGE_GIT_REPOSITORY/Clones

Operation Type: CRUD

**HTTP Method:**POST

Request Headers


Header

Required

Values

Accept

no

application/json

application/xml

Contentt-Type

no

application/json

application/xml

x-csrf-token

no

fetch

Request Parameters


Parameter

Required

Data Type

Description

Parameter Type

sc_name

yes

string

name of the software component

Request body

branch_name

no

string

name of the branch

Request body

commit_id

no

string

commit ID

Request body

Request Example

Sample Code:

POST/sap/opu/odata/sap/MANAGE_GIT_REPOSITORY/Clones HTTP/1.1
Host: host.com
Authentication: basicAuthentication
X-csrf-token: xCsrfToken
Content-Type: application/json
Accept: application/json
 
{
        "sc_name" : "/DMO/GIT_REPOSITORY"
        "branch_name": "main"
}

Response Status and Error Codes


Code

Reason

Description

201

Created

Created a clone job

400

Bad Request

Could not read the clone job. Please check the parameters.

Request Payload Example

Sample Code:

{
    "d": {
            {
                "__metadata": {
                    "id": "host.com/sap/opu/odata/sap/MANAGE_GIT_REPOSITORY/Clones(uuid=guid'02ceab7d-ff04-1eda-b1ea-eb7fdbf28bc4',sc_name='ZHM_INITIAL_TEST',branch_name='')",
                    "uri": "host.com/sap/opu/odata/sap/MANAGE_GIT_REPOSITORY/Clones(uuid=guid'02ceab7d-ff04-1eda-b1ea-eb7fdbf28bc4',sc_name='ZHM_INITIAL_TEST',branch_name='')",
                    "type": "cds_sd_a4c_a2g_gha_sc_web_api.ClonesType"
                },
                "uuid": "02ceab7d-ff04-1eda-b1ea-eb7fdbf28bc4",
                "sc_name": "/DMO/GIT_REPOSITORY",
                "branch_name": "",
                "import_type": "Clone",
                "namespace": "",
                "status": "S",
                "status_descr": "Success",
                "criticality": 3,
                "user_name": "administrator@example.com",
                "start_time": "/Date(1594898863000+0000)/",
                "change_time": "/Date(1594898891000+0000)/"
            }
       
    }
}