Uploading a Package Group
Function
This API is used to upload a package group to a project.
Debugging
You can debug this API in API Explorer.
URI
- URI format
- Parameter description
Table 1 URI parameter description Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.
Request
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| paths | Yes | Array of Strings | List of OBS object paths. The OBS object path refers to the OBS object URL. |
| kind | Yes | String | File type of a package group.
NOTE: If the same group of packages to be uploaded contains different file types, select file as the type of the file to be uploaded. |
| group | Yes | String | Name of the group to be created. |
| is_async | No | Boolean | Whether to upload resource packages in asynchronous mode. The default value is false, indicating that the asynchronous mode is not used. You are advised to upload resource packages in asynchronous mode. |
| tags | No | Array of Strings | Resource tag. For details, see Table 3. |
Response
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| group_name | No | String | Group name. |
| status | No | String | Status of a package group to be uploaded. |
| resources | No | Array of strings | List of names of resource packages contained in the group. |
| details | No | Array of body | Details about a group resource package. For details, see Table 5. |
| create_time | No | Long | UNIX timestamp when a package group is uploaded. |
| update_time | No | Long | UNIX timestamp when a package group is updated. |
| is_async | No | Boolean | Whether to upload resource packages in asynchronous mode. The default value is false, indicating that the asynchronous mode is not used. You are advised to upload resource packages in asynchronous mode. |
| owner | No | String | Owner of a resource package. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| create_time | Yes | Long | UNIX time when a resource package is uploaded. The timestamp is expressed in milliseconds. |
| update_time | No | Long | UNIX time when the uploaded resource package is uploaded. The timestamp is expressed in milliseconds. |
| resource_type | Yes | String | Resource type. |
| resource_name | No | String | Resource name. |
| status | No | String |
|
| underlying_name | No | String | Name of the resource packages in a queue. |
| is_async | No | Boolean | Whether to upload resource packages in asynchronous mode. The default value is false, indicating that the asynchronous mode is not used. You are advised to upload resource packages in asynchronous mode. |
Examples
- Example request
{ "paths": [ "https://xkftest.obs.huawei.com/txr_test/jars/spark-sdv-app.jar", "https://xkftest.obs.huawei.com/txr_test/jars/wordcount", "https://xkftest.obs.huawei.com/txr_test/jars/wordcount.py" ], "kind": "jar", "group": "gatk", "is_async":"true" } - Example response (successful request)
{ "group_name": "gatk", "status": "READY", "resources": [ "spark-sdv-app.jar", "wordcount", "wordcount.py" ], "details": [ { "create_time": 0, "update_time": 0, "resource_type": "jar", "resource_name": "spark-sdv-app.jar", "status": "READY", "underlying_name": "987e208d-d46e-4475-a8c0-a62f0275750b_spark-sdv-app.jar" }, { "create_time": 0, "update_time": 0, "resource_type": "jar", "resource_name": "wordcount", "status": "READY", "underlying_name": "987e208d-d46e-4475-a8c0-a62f0275750b_wordcount" }, { "create_time": 0, "update_time": 0, "resource_type": "jar", "resource_name": "wordcount.py", "status": "READY", "underlying_name": "987e208d-d46e-4475-a8c0-a62f0275750b_wordcount.py" } ], "create_time": 1551334579654, "update_time": 1551345369070 }
Status Codes
Table 6 describes the status code.
Error Codes
If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Code.
Last Article: Package Group-related APIs
Next Article: Querying Package Group List
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.