Importing Resource Packages
Function
This API is used to import resource packages.
URI
POST /v1/{project_id}/resource-package/api-import
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For how to obtain a project ID, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Workspace-Id |
Yes |
String |
Workspace ID. For how to obtain it, see Obtaining a Workspace ID. |
X-Auth-Token |
Yes |
String |
User token. |
Content-Type |
Yes |
String |
Request body type and character set, which have fixed values. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
file |
Yes |
File |
Resource package file. |
import_strategy |
Yes |
String |
Import strategy. The options are replace and addNew. |
replace_rule |
No |
String |
Replacement rule. The default value is BY_ID. The options are BY_ID and BY_NAME. Enumerated values:
|
Response Parameters
Parameter |
Type |
Description |
---|---|---|
task_id |
String |
Task ID. |
Example Request
Import a resource package.
POST https://{endpoint}/v1/{project_id}/resource-package/api-import { "file": File stream, "import_strategy": "replace", "replace_rule": "BY_ID" }
Example Response
The resource package is successfully imported.
{ "task_id" : "b8913c92-xxxx-4721-b8fd-a72af3945b61" }
Status Codes
Status Code |
Description |
---|---|
200 |
The resource package is successfully imported. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot