-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MGMT-11404: add rest-api doc for cluster tags (#4252)
Added documentation for creating/updating cluster tags using the rest-api (in docs/user-guide).
- Loading branch information
1 parent
99e02e2
commit 2343139
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# REST-API - Cluster Tags | ||
|
||
The `tags` property in cluster object is a comma-separated list of tags that are associated to the cluster. Each tag is a free-text string that can consist of the following characters: | ||
Alphanumeric (aA-zZ, 0-9), underscore (_) and white-spaces. | ||
|
||
Tags are not read or manipulated by the system, so they can be used for marking clusters with some filtering criteria, installation tracking indication, etc. | ||
|
||
## Usage | ||
|
||
* The property can be specified when creating (v2RegisterCluster) or updating (V2UpdateCluster) a cluster. | ||
* The tags are stored in the cluster object, so the property can be fetched when getting (v2GetCluster) the cluster. | ||
* The property can be cleared by specifying an empty string. | ||
|
||
|
||
## Examples | ||
|
||
### Create tags (using v2RegisterCluster) | ||
|
||
```bash | ||
cat register_cluster.json | ||
{ | ||
"name":"test", | ||
"pull_secret":"<pull_secret>", | ||
"openshift_version":"4.10", | ||
"tags":"tag1,tag_2,tag 3" | ||
} | ||
``` | ||
|
||
```bash | ||
curl -X POST -H "Content-Type: application/json" -d @register_cluster.json \ | ||
<HOST>:<PORT>/api/assisted-install/v2/clusters | ||
``` | ||
|
||
### Update tags (using V2UpdateCluster) | ||
|
||
```bash | ||
cat update_cluster.json | ||
{ | ||
"tags":"tag1,tag_2,tag 3,tag4" | ||
} | ||
``` | ||
|
||
```bash | ||
curl -X PATCH -H "Content-Type: application/json" -d @update_cluster.json \ | ||
<HOST>:<PORT>/api/assisted-install/v2/clusters/<cluster_id> | ||
``` | ||
|
||
### Get tags (using v2GetCluster) | ||
|
||
```bash | ||
curl <HOST>:<PORT>/api/assisted-install/v2/clusters/<cluster_id> | jq '.tags' | ||
|
||
output: "tag1,tag_2,tag 3,tag4" | ||
``` |