Importing resources

May 15, 2024

ID 270068

POST /api/v1/kuma/resources/import

Access: General administrator, Tenant administrator, Tier 2 analyst, Tier 1 analyst.

Request body

Name

Data type

Mandatory

Description

Value example

fileID

string

Yes

The file ID obtained as a result of loading the resource file.

00000000-0000-0000-0000-000000000000

password

string

Yes

Resource file password.

SomePassword!88

tenantID

string

Yes

ID of the target tenant

00000000-0000-0000-0000-000000000000

actions

map[string]uint8

Yes

Mapping of the resource ID to the action that must be taken in relation to it.

0 – do not import (used when resolving conflicts)

1 – import (should initially be assigned to each resource)

2 – replace (used when resolving conflicts)

{

    "00000000-0000-0000-0000-000000000000": 0,

    "00000000-0000-0000-0000-000000000001": 1,

    "00000000-0000-0000-0000-000000000002": 2,

}

 

Response

HTTP code

Body

204

 

409

The imported resources conflict with the existing ones by ID. In this case, you need to repeat the import operation while specifying the following actions for these resources:

0 – do not import

2 – replace

type ImportConflictsError struct {

    HardConflicts []string `json:"conflicts"`

}

 

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.