diff --git a/static/api-specs/nerm/openapi.yaml b/static/api-specs/nerm/openapi.yaml index e43521f19d2..3e9563e5aec 100644 --- a/static/api-specs/nerm/openapi.yaml +++ b/static/api-specs/nerm/openapi.yaml @@ -40,6 +40,9 @@ paths: $ref: "./paths/role.yaml" /roles/{id}: $ref: "./paths/roles_id.yaml" +# System Roles + /system_roles: + $ref: "./paths/system_roles.yaml" # Permissions /permissions: $ref: "./paths/permissions.yaml" diff --git a/static/api-specs/nerm/paths/system_roles.yaml b/static/api-specs/nerm/paths/system_roles.yaml new file mode 100644 index 00000000000..523e6a1c795 --- /dev/null +++ b/static/api-specs/nerm/paths/system_roles.yaml @@ -0,0 +1,16 @@ +get: + summary: Get system roles + operationId: getSystemRoles + description: This endpoint can retrieve system roles from NERM. Optionally you can provide parameters to filter results. + tags: + - system roles + parameters: + - $ref: "../parameters/query/query.yaml" + - $ref: "../parameters/query/metadata.yaml" + responses: + '200': + $ref: "../responses/System_Roles_Meta.yaml" + '400': + $ref: "../responses/400.yaml" + '500': + $ref: "../responses/500.yaml" \ No newline at end of file diff --git a/static/api-specs/nerm/responses/System_Roles_Meta.yaml b/static/api-specs/nerm/responses/System_Roles_Meta.yaml new file mode 100644 index 00000000000..78d6f37efa7 --- /dev/null +++ b/static/api-specs/nerm/responses/System_Roles_Meta.yaml @@ -0,0 +1,12 @@ +description: Expected response to a valid request +content: + application/json: + schema: + type: object + properties: + system_roles: + type: array + items: + $ref: '../schemas/GET/SystemRole.yaml' + _metadata: + $ref: '../schemas/Metadata.yaml' \ No newline at end of file diff --git a/static/api-specs/nerm/schemas/GET/SystemRole.yaml b/static/api-specs/nerm/schemas/GET/SystemRole.yaml new file mode 100644 index 00000000000..57d7e0adb12 --- /dev/null +++ b/static/api-specs/nerm/schemas/GET/SystemRole.yaml @@ -0,0 +1,21 @@ +type: object +properties: + id: + type: string + format: uuid + description: The unique identifier for the object + example: 2e06b876-f456-473d-bd65-b6435e0b6b2d + readOnly: true + uid: + type: string + description: The user identifier for the object + minLength: 32 + maxLength: 32 + readOnly: true + enum: [profile_contributor, profile_owner] + example: "profile_contributor" + name: + description: The name of the role + type: string + enum: [Profile Contributor, Profile Owner] + example: "Profile Contributor" \ No newline at end of file diff --git a/static/api-specs/nerm/schemas/GET/SystemRoles.yaml b/static/api-specs/nerm/schemas/GET/SystemRoles.yaml new file mode 100644 index 00000000000..35cee762f9e --- /dev/null +++ b/static/api-specs/nerm/schemas/GET/SystemRoles.yaml @@ -0,0 +1,6 @@ +type: object +properties: + system_roles: + type: array + items: + $ref: '../GET/SystemRole.yaml' \ No newline at end of file