Skip to content

Commit

Permalink
Merge pull request #1098 from alex-smile/ft_esb_update_apis_20230727
Browse files Browse the repository at this point in the history
update cc confapis
  • Loading branch information
alex-smile authored Jul 27, 2023
2 parents c8d25ba + fa22b24 commit cd1b3d9
Show file tree
Hide file tree
Showing 13 changed files with 868 additions and 3 deletions.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.55
2.14.56
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
### Function description

batch create quoted model instance (version: v3.10.30+, permission: update permission of the source model instance)

### Request parameters

{{ common_args_desc }}

#### Interface parameters

| Field | Type | Required | Description |
|----------------|--------------|----------|------------------------------------------------------|
| bk_obj_id | string | yes | source model id |
| bk_property_id | string | yes | source model quoted property id |
| data | object array | yes | instance data to be created, the maximum limit is 50 |

#### data[n]

| Field | Type | Required | Description |
|-------------|--------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| bk_inst_id | int64 | no | source model instance id, if not set, the created instance should be associated with source model instance using create_inst |
| name | string | depends on the "isrequired" config of the property | name, this is only an example, actual fields is defined by quoted model properties |
| operator | string | depends on the "isrequired" config of the property | operator, this is only an example, actual fields is defined by quoted model properties |
| description | string | depends on the "isrequired" config of the property | description, this is only an example, actual fields is defined by quoted model properties |

### Request parameter examples

```json
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_username": "xxx",
"bk_token": "xxx",
"bk_obj_id": "host",
"bk_property_id": "disk",
"data": [
{
"bk_inst_id": 123,
"name": "test",
"operator": "user",
"description": "test instance"
}
]
}
```

### Return Result Example

```json
{
"result": true,
"code": 0,
"message": "success",
"permission": null,
"data": {
"ids": [
1,
2
]
},
"request_id": "dsda1122adasadadada2222"
}
```

**Note:**

- The order of the array of ids in the returned data remains the same as the order of the array data in the parameters.

### Return result parameter description

#### response

| Name | Type | Description |
|------------|--------|-----------------------------------------------------------------------------------------------------|
| result | bool | The success or failure of the request. true: the request was successful; false: the request failed. |
| code | int | The error code. 0 means success, >0 means failure error. |
| message | string | The error message returned by the failed request. |
| permission | object | Permission information |
| request_id | string | request_chain_id |
| data | object | data returned by the request |

#### data

| Name | Type | Description |
|------|-------|----------------------------------------------------|
| ids | array | unique identifier array of created instances in cc |
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
### Function description

batch delete quoted model instance (version: v3.10.30+, permission: update permission of the source model instance)

### Request parameters

{{ common_args_desc }}

#### Interface parameters

| Field | Type | Required | Description |
|----------------|-------------|----------|--------------------------------------------------------------------|
| bk_obj_id | string | yes | source model id |
| bk_property_id | string | yes | source model quoted property id |
| ids | int64 array | yes | id list of quoted instance to be deleted, the maximum limit is 500 |

### Request parameter examples

```json
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_username": "xxx",
"bk_token": "xxx",
"bk_obj_id": "host",
"bk_property_id": "disk",
"ids": [
1,
2
]
}
```

### Return Result Example

```json
{
"result": true,
"code": 0,
"message": "success",
"permission": null,
"request_id": "dsda1122adasadadada2222"
}
```

### Return result parameter description

#### response

| Name | Type | Description |
|------------|--------|-----------------------------------------------------------------------------------------------------|
| result | bool | The success or failure of the request. true: the request was successful; false: the request failed. |
| code | int | The error code. 0 means success, >0 means failure error. |
| message | string | The error message returned by the failed request. |
| permission | object | Permission information |
| request_id | string | request_chain_id |
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
### Function description

batch update quoted model instance (version: v3.10.30+, permission: update permission of the source model instance)

### Request parameters

{{ common_args_desc }}

#### Interface parameters

| Field | Type | Required | Description |
|----------------|-------------|----------|--------------------------------------------------------------------|
| bk_obj_id | string | yes | source model id |
| bk_property_id | string | yes | source model quoted property id |
| ids | int64 array | yes | id list of quoted instance to be updated, the maximum limit is 500 |
| data | object | yes | the quoted instance data to be updated |

#### data

| Field | Type | Required | Description |
|-------------|--------|--------------------------------------------------|-------------------------------------------------------------------------------------------|
| name | string | at least one of the fields in "data" is required | name, this is only an example, actual fields is defined by quoted model properties |
| operator | string | at least one of the fields in "data" is required | operator, this is only an example, actual fields is defined by quoted model properties |
| description | string | at least one of the fields in "data" is required | description, this is only an example, actual fields is defined by quoted model properties |

### Request parameter examples

```json
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_username": "xxx",
"bk_token": "xxx",
"bk_obj_id": "host",
"bk_property_id": "disk",
"ids": [
1,
2
],
"data": {
"name": "test",
"operator": "user",
"description": "test instance"
}
}
```

### Return Result Example

```json
{
"result": true,
"code": 0,
"message": "success",
"permission": null,
"request_id": "dsda1122adasadadada2222"
}
```

### Return result parameter description

#### response

| Name | Type | Description |
|------------|--------|-----------------------------------------------------------------------------------------------------|
| result | bool | The success or failure of the request. true: the request was successful; false: the request failed. |
| code | int | The error code. 0 means success, >0 means failure error. |
| message | string | The error message returned by the failed request. |
| permission | object | Permission information |
| request_id | string | request_chain_id |
2 changes: 1 addition & 1 deletion paas2/esb/components/confapis/cc/apidocs/en/create_inst.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Create instance
}
}

Other fields that belong to instance properties can also be input parameters.
Other fields that belong to instance properties can also be input parameters. The value of the 'table' type attribute is the id list of the quoted table type model instance (need to be created through the batch_create_quoted_inst interface first), up to 50.


### Request Parameters Example
Expand Down
Loading

0 comments on commit cd1b3d9

Please sign in to comment.