Skip to content

Commit

Permalink
Merge branch 'bug_24674/tenant_api_documentation_has_several_problems…
Browse files Browse the repository at this point in the history
…_pr' into branches/rudder/8.1
  • Loading branch information
Jenkins CI committed Apr 12, 2024
2 parents 0076565 + c9b0767 commit bf25b9a
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl --header "X-API-Token: yourToken" --request DELETE --header "Content-Type: application/json" 'https://rudder.example.com/rudder/api/latest/securitytags/nodes' --data '["node1","node2"]'

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl --header "X-API-Token: yourToken" --request POST --header "Content-Type: application/json" 'https://rudder.example.com/rudder/api/latest/securitytags/nodes' --data '[{"tenantId":"zone1","nodeIds":["node1","node2"]},{"tenantId":"zone2", "nodeIds":["node3"]}]'
2 changes: 1 addition & 1 deletion webapp/sources/api-doc/code_samples/curl/tenants/add.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
curl --header "X-API-Token: yourToken" --request POST 'https://rudder.example.com/rudder/api/latest/tenants' --data '[{"id":"zone1","name":"Zone One"}]'
curl --header "X-API-Token: yourToken" --request POST --header "Content-Type: application/json" 'https://rudder.example.com/rudder/api/latest/tenants' --data '[{"id":"zone1","name":"Zone One"}]'
2 changes: 1 addition & 1 deletion webapp/sources/api-doc/code_samples/curl/tenants/delete.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
curl --header "X-API-Token: yourToken" --request DELETE 'https://rudder.example.com/rudder/api/latest/tenants' --data '["zone1","zone2"]'
curl --header "X-API-Token: yourToken" --request DELETE --header "Content-Type: application/json" 'https://rudder.example.com/rudder/api/latest/tenants' --data '["zone1","zone2"]'
2 changes: 1 addition & 1 deletion webapp/sources/api-doc/code_samples/curl/tenants/set.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
curl --header "X-API-Token: yourToken" --request POST 'https://rudder.example.com/rudder/api/latest/tenants/set' --data '[{"id":"zone1","name":"Zone One"}]'
curl --header "X-API-Token: yourToken" --request POST --header "Content-Type: application/json" 'https://rudder.example.com/rudder/api/latest/tenants/set' --data '[{"id":"zone1","name":"Zone One"}]'
79 changes: 72 additions & 7 deletions webapp/sources/api-doc/paths/securitytags/nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ post:
description: a node ID on which the tenant must be defined
responses:
"200":
description: The list of tenants with their documentation information
description: The list of nodes on which the tenant was changed (unchanged nodes are not included)
content:
application/json:
schema:
Expand All @@ -46,19 +46,84 @@ post:
type: string
description: The id of the action
enum:
- listGroups
- setNodeSecurityTag
data:
type: object
required:
- tenants
- securitytags
properties:
groups:
securitytags:
type: array
items:
$ref: ../../components/schemas/tenant.yml
type: object
required:
- tenantId
- nodeIds
properties:
tenantId:
type: string
description: the ID of the tenant set on nodes
nodeIds:
type: array
items:
type: string
description: a node ID on which the tenant was changed and set to input value
tags:
- Tenants
- Multi-tenants
x-codeSamples:
- lang: curl
source:
$ref: ../../code_samples/curl/securitytags/nodes.sh
$ref: ../../code_samples/curl/securitytags/setOnNodes.sh

delete:
summary: Remove tenant value on nodes
description: Remove defined tenant on the list of nodes. Nodes without a tenant are not changed.
operationId: deleteNodeSecurityTag
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
type: string
description: a node ID on which the tenant must be removed
responses:
"200":
description: The list of tenants
content:
application/json:
schema:
type: object
required:
- result
- action
- data
properties:
result:
type: string
description: Result of the request
enum:
- success
- error
action:
type: string
description: The id of the action
enum:
- deleteNodeSecurityTag
data:
type: object
required:
- nodes
properties:
nodes:
type: array
items:
type: string
description: a node ID on which the tenant was removed
tags:
- Multi-tenants
x-codeSamples:
- lang: curl
source:
$ref: ../../code_samples/curl/securitytags/deleteOnNodes.sh
10 changes: 5 additions & 5 deletions webapp/sources/api-doc/paths/tenants/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ get:
type: string
description: The id of the action
enum:
- listGroups
- getTenant
data:
type: object
required:
- tenants
properties:
groups:
tenants:
type: array
items:
$ref: ../../components/schemas/tenant.yml
tags:
- Tenants
- Multi-tenants
x-codeSamples:
- lang: curl
source:
Expand Down Expand Up @@ -122,9 +122,9 @@ delete:
data:
type: object
required:
- groups
- tenants
properties:
groups:
tenants:
type: array
items:
type: string
Expand Down

0 comments on commit bf25b9a

Please sign in to comment.