The HPE GreenLake for Authorization API provides a unified way to manage the authorization function for HPE GreenLake cloud.
HPE GreenLake for Authorization API (1.0.0-beta)
https://global.api.greenlake.hpe.com/
https://developer.greenlake.hpe.com/_mock/docs/greenlake/services/authorization/public/openapi/authz-v1beta1/external-authz-v2-config/
Roles
Roles are created in a Workspace, typically by an IAM administrator. They may be created by a Resource Provider (RP) if the RP has been granted the required privileges in the Workspace.
Requirements
- Roles must include at least one inline permission.
- There is a max limit of 100 Roles per workspace (in addition to the global predefined roles).
Role Assignments
Role assignments are composed of three pieces (principal, role, and scope). Role assigments associate a user, group, or service (principal) with a specific role (along with its permissions) at a particular scope (a resource or group of resources) to grant them access and specify their responsibilities within HPE GreenLake.
Note: There is a maximum limit of 50 role assignments per user per workspace.
Request
Create a role assignment.
By creating a role assignment, you grant access to resources. Role assignments allow for controlled management of permissions and responsibilities.
Note: For assistance finding the principal, scope, and role identifiers, see the developer guide.
The security principal identifier {type}:{id}. A principal is the entity that receives a role. The supported types are user, user-group, and api-client.
Fully qualified scope string in GRN syntax. A scope is the specific resource or set of resources to which the role and its permissions apply. The scopes can be at the workspace level (limited to 1), tenant groups (up to 10), and scope groups (up to 10), and can be combined: Workspace + Tenant Group or Tenant Group + Scope Group.
https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments
- Mock server
https://developer.greenlake.hpe.com/_mock/docs/greenlake/services/authorization/public/openapi/authz-v1beta1/external-authz-v2-config/authorization/v1beta1/role-assignments
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X POST \
https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"principal": "user:123981y2zxhiz1890",
"role": "grn:glp/providers/authorization/roles/storageservices.LimitedAdmin",
"scope": [
"grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/msp/tenant-groups/d88d38c9-8cf7-4ab8-a808-126b47bb787d",
"grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/authorization/scope-groups/21e582d3-fb24-4162-9fca-350defe24d3c"
]
}'Created
The type of the resource.
The security principal identifier {type}:{id}. A principal is the entity that receives a role. The supported types are user, user-group, and api-client.
Fully qualified scope string in GRN syntax. A scope is the specific resource or set of resources to which the role and its permissions apply. The scopes can be at the workspace level (limited to 1), tenant groups (up to 10), and scope groups (up to 10), and can be combined: Workspace + Tenant Group or Tenant Group + Scope Group.
The unique role identifier in GRN syntax. A role is a collection of permissions defining what actions the principal can perform.
{ "id": "05f2523c-fe03-47fc-981b-9c4333a37b01", "type": "authorization/role-assignment", "principal": "user:123981y2zxhiz1890", "role": "grn:glp/providers/authorization/roles/storageservices.LimitedAdmin", "scope": [ "grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b60" ], "principalMetadata": { "id": "123981y2zxhiz1890", "type": "identity/user" }, "roleMetadata": { "id": "e54415a9-4f46-43c0-893e-67ec778c6c45", "type": "authorization/role" }, "generation": 1, "createdAt": "2023-04-06T22:45:59.759943+00:00", "updatedAt": "2023-04-06T22:45:59.759943+00:00" }
Request
Retrieves role assignments by applying OData 4.0 filters. Use the filter parameter to provide a filter string. Supports in and and operators on role, scope and principal attributes.
Example Request: /authorization/v1beta1/role-assignments?filter=role in ('grn:glp/providers/authorization/roles/storageservices.LimitedAdmin') and principal in ('user:123981y2zxhiz1890')
Note:
- No duplicate attributes in OData filter: Each attribute (role, scope, principal) can only appear once in the OData filter expression. Multiple occurrences will result in a 400 Bad Request error.
- Supported operators: Only the in and and operators are supported.
The filter query parameter is used to filter the set of resources returned in a collection-level GET. The returned set of resources matches the criteria in the filter query parameter.
Supports in and and operators on role, scope and principal attributes.
https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments
- Mock server
https://developer.greenlake.hpe.com/_mock/docs/greenlake/services/authorization/public/openapi/authz-v1beta1/external-authz-v2-config/authorization/v1beta1/role-assignments
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'OK
The type of the resource.
The security principal identifier {type}:{id}. A principal is the entity that receives a role. The supported types are user, user-group, and api-client.
Fully qualified scope string in GRN syntax. A scope is the specific resource or set of resources to which the role and its permissions apply. The scopes can be at the workspace level (limited to 1), tenant groups (up to 10), and scope groups (up to 10), and can be combined: Workspace + Tenant Group or Tenant Group + Scope Group.
The unique role identifier in GRN syntax. A role is a collection of permissions defining what actions the principal can perform.
{ "items": [ { … } ], "count": 1, "total": 1, "offset": 0 }
https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments/{id}
- Mock server
https://developer.greenlake.hpe.com/_mock/docs/greenlake/services/authorization/public/openapi/authz-v1beta1/external-authz-v2-config/authorization/v1beta1/role-assignments/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X GET \
'https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'OK
The type of the resource.
The security principal identifier {type}:{id}. A principal is the entity that receives a role. The supported types are user, user-group, and api-client.
Fully qualified scope string in GRN syntax. A scope is the specific resource or set of resources to which the role and its permissions apply. The scopes can be at the workspace level (limited to 1), tenant groups (up to 10), and scope groups (up to 10), and can be combined: Workspace + Tenant Group or Tenant Group + Scope Group.
The unique role identifier in GRN syntax. A role is a collection of permissions defining what actions the principal can perform.
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "type": "authorization/role-assignment", "principal": "user:123981y2zxhiz1890", "role": "grn:glp/providers/authorization/roles/storageservices.LimitedAdmin", "scope": [ "grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/msp/tenant-groups/d88d38c9-8cf7-4ab8-a808-126b47bb787d", "grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/authorization/scope-groups/21e582d3-fb24-4162-9fca-350defe24d3c" ], "principalMetadata": { "id": "123981y2zxhiz1890", "type": "identity/user" }, "roleMetadata": { "id": "44f0443c-fd03-47fc-981b-9c4333a37b44", "type": "authorization/role" }, "generation": 1, "createdAt": "2023-04-06T22:45:59.759943+00:00", "updatedAt": "2023-04-06T22:45:59.759943+00:00", "source": "LOCAL" }
Request
Request body must contain id, principal, scope, and role attributes even though they are immutable.
The id can be found at the response body of POST /authorization/v1beta1/role-assignments.
Note: For assistance finding the principal, scope, and role identifiers, see the developer guide.
The security principal identifier {type}:{id}. A principal is the entity that receives a role. The supported types are user, user-group, and api-client.
Fully qualified scope string in GRN syntax. A scope is the specific resource or set of resources to which the role and its permissions apply. The scopes can be at the workspace level (limited to 1), tenant groups (up to 10), and scope groups (up to 10), and can be combined: Workspace + Tenant Group or Tenant Group + Scope Group.
https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments/{id}
- Mock server
https://developer.greenlake.hpe.com/_mock/docs/greenlake/services/authorization/public/openapi/authz-v1beta1/external-authz-v2-config/authorization/v1beta1/role-assignments/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X PUT \
'https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"principal": "user:123981y2zxhiz1890",
"role": "grn:glp/providers/authorization/roles/storageservices.LimitedAdmin",
"scope": [
"grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/msp/tenant-groups/d88d38c9-8cf7-4ab8-a808-126b47bb787d",
"grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/authorization/scope-groups/21e582d3-fb24-4162-9fca-350defe24d3c"
]
}'OK
The type of the resource.
The security principal identifier {type}:{id}. A principal is the entity that receives a role. The supported types are user, user-group, and api-client.
Fully qualified scope string in GRN syntax. A scope is the specific resource or set of resources to which the role and its permissions apply. The scopes can be at the workspace level (limited to 1), tenant groups (up to 10), and scope groups (up to 10), and can be combined: Workspace + Tenant Group or Tenant Group + Scope Group.
The unique role identifier in GRN syntax. A role is a collection of permissions defining what actions the principal can perform.
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "type": "authorization/role-assignment", "principal": "user:123981y2zxhiz1890", "role": "grn:glp/providers/authorization/roles/storageservices.LimitedAdmin", "scope": [ "grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/msp/tenant-groups/d88d38c9-8cf7-4ab8-a808-126b47bb787d", "grn:glp/workspaces/05f0523c-fd03-47fc-981b-9c4333a37b70/regions/default/providers/authorization/scope-groups/21e582d3-fb24-4162-9fca-350defe24d3c" ], "principalMetadata": { "id": "123981y2zxhiz1890", "type": "identity/user" }, "roleMetadata": { "id": "44f0443c-fd03-47fc-981b-9c4333a37b44", "type": "authorization/role" }, "generation": 1, "createdAt": "2023-04-06T22:45:59.759943+00:00", "updatedAt": "2023-04-06T22:45:59.759943+00:00" }
https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments/{id}
- Mock server
https://developer.greenlake.hpe.com/_mock/docs/greenlake/services/authorization/public/openapi/authz-v1beta1/external-authz-v2-config/authorization/v1beta1/role-assignments/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- Go
- C#
- PHP
curl -i -X DELETE \
'https://global.api.greenlake.hpe.com/authorization/v1beta1/role-assignments/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'