Managing Organization
A organization in Shield looks like
{
"organizations": [
{
"id": "4eb3c3b4-962b-4b45-b55b-4c07d3810ca8",
"name": "gotocompany",
"slug": "gotocompany",
"metadata": {
"description": "Goto company"
},
"createdAt": "2022-12-07T14:10:42.755848Z",
"updatedAt": "2022-12-07T14:10:42.755848Z"
}
]
}
API Interface
Create Organizations
- HTTP
- CLI
$ curl --location --request POST 'http://localhost:8000/admin/v1beta1/organizations'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--data-raw '{
"name": "gotocompany",
"slug": "gotocompany",
"metadata": {
"description": "Goto company"
}
}'
$ shield organization create --file org.yaml --header key:value
List Organizations
- HTTP
- CLI
$ curl --location --request GET 'http://localhost:8000/admin/v1beta1/organizations'
--header 'Accept: application/json'
$ shield organization list
Get Organizations
- HTTP
- CLI
$ curl --location --request GET 'http://localhost:8000/admin/v1beta1/organizations/4eb3c3b4-962b-4b45-b55b-4c07d3810ca8'
--header 'Accept: application/json'
$ shield organization view 4eb3c3b4-962b-4b45-b55b-4c07d3810ca8 --metadata
Update Organizations
- HTTP
- CLI
$ curl --location --request PUT 'http://localhost:8000/admin/v1beta1/organizations/4eb3c3b4-962b-4b45-b55b-4c07d3810ca8'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--data-raw '{
"name": "gotocompany",
"slug": "gotocompany",
"metadata": {
"description": "Goto company",
"url": "github.com/goto"
}
} '
$ shield organization edit 4eb3c3b4-962b-4b45-b55b-4c07d3810ca8 --file=org.yaml