From ca11e2bd9ba426886ea41bfb61c5443dc06ad1eb Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Wed, 12 Jan 2022 15:12:57 +0530 Subject: [PATCH] Updated rest examples file --- components/usermgmt/master.rest | 104 ++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 5 deletions(-) diff --git a/components/usermgmt/master.rest b/components/usermgmt/master.rest index d3886e8..0427b53 100644 --- a/components/usermgmt/master.rest +++ b/components/usermgmt/master.rest @@ -1,14 +1,45 @@ :host = http://localhost:11000 :partner = 439fd1c6-e947-4dad-a9e9-ca1f50898f85 :org = 960bb196-76b2-430a-a72e-88d8362c07c3 +:group = my-group +:role = my-role +:groupid = 99f4ea22-089c-4016-a1f9-e8b156d34cf5 +:roleid = 3de58ba8-a42f-49bb-b8bd-052363123fdc :userid = 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7 +:projectid = c61ec2fe-543c-4e10-a1b6-c53c43fb9ca4 ## Users # Create user POST :host/auth/v3/partner/:partner/organization/:org/users -{"spec": {"username": "anothernewguy@notaprovider.com", "firstName": "John", "lastName": "Doe"}} --> jq-set-var :userid .metadata.id +{"spec": {"username": "updatduser@notaprovider.com", "firstName": "John", "lastName": "Doe"}} + +# Create user with roles +POST :host/auth/v3/partner/:partner/organization/:org/users +Content-Type: application/yaml + +spec: + username: tany@notarvider.com + firstName: John + lastName: Doe + projectnamespaceroles: + - role: :roleid + namespace: 7 + project: :projectid + - role: :roleid + namespace: 9 + project: :projectid + +# Create user with groups +POST :host/auth/v3/partner/:partner/organization/:org/users +Content-Type: application/yaml + +spec: + username: aegy@notaprovider.com + firstName: John + lastName: Doe + groups: + - :groupid # Get all users GET :host/auth/v3/partner/:partner/organization/:org/users @@ -27,17 +58,80 @@ DELETE :host/auth/v3/partner/:partner/organization/:org/user/:userid ## Groups # Create group - POST :host/auth/v3/partner/:partner/organization/:org/groups Content-Type: application/yaml metadata: - name: my-group + name: :groupname description: My first description partner: :partner organization: :org spec: type: simple + users: + - 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7 + projectnamespaceroles: + - role: :roleid + namespace: 7 + project: :projectid + +# Create group no namespace +POST :host/auth/v3/partner/:partner/organization/:org/groups +Content-Type: application/yaml + +metadata: + name: :groupname + description: My first description + partner: :partner + organization: :org +spec: + type: simple + users: + - 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7 + projectnamespaceroles: + - role: :roleid + project: :projectid + +# Create group no namespace and project +POST :host/auth/v3/partner/:partner/organization/:org/groups +Content-Type: application/yaml + +metadata: + name: :groupname + description: My first description + partner: :partner + organization: :org +spec: + type: simple + users: + - 8f35abd7-0c8c-4770-a2c7-430f79bb5eb7 + projectnamespaceroles: + - role: :roleid # Get all groups -GET :host/auth/v3/partner/:partner/organization/:org/groups \ No newline at end of file +GET :host/auth/v3/partner/:partner/organization/:org/groups + +# Get a group +GET :host/auth/v3/partner/:partner/organization/:org/group/:groupid + + +## Roles + +# Create role + +POST :host/auth/v3/partner/:partner/organization/:org/roles +Content-Type: application/yaml + +metadata: + name: :role + description: My first role + partner: :partner + organization: :org +spec: + type: simple + +# Get all roles +GET :host/auth/v3/partner/:partner/organization/:org/roles + +# Get a role +GET :host/auth/v3/partner/:partner/organization/:org/role/:role \ No newline at end of file