Help Center> Cloud Stream Service> API Reference> Permissions Policies and Supported Actions

Permissions Policies and Supported Actions

This chapter describes fine-grained permissions management for your CS. If your HUAWEI CLOUD account does not require individual IAM users, you can skip this chapter.

By default, new IAM users do not have permissions assigned. You need to add a user to one or more groups, and attach permissions policies or roles to these groups. Users inherit permissions from the groups to which they are added and can perform specified operations on cloud services based on the permissions. For more information about policy syntax and example policies, see Permissions Management.

You can grant users permissions by using roles and policies.
  • Roles are a type of coarse-grained authorization mechanism that defines permissions related to user responsibilities. This mechanism provides only a limited number of service-level roles for authorization. When using roles to grant permissions, you need to also assign other roles on which the permissions depend to take effect. However, roles are not an ideal choice for fine-grained authorization and secure access control.
  • Policies: A type of fine-grained authorization mechanism that defines permissions required to perform operations on specific cloud resources under certain conditions. This mechanism allows for more flexible policy-based authorization, meeting requirements for secure access control. For example, you can grant CS users only the permissions for managing a certain type of cloud servers.

Policy-based authorization is useful if you want to allow or deny the access to an API.

An account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned. The permissions required for calling an API are determined by the actions supported by the API. Only users that have been granted permissions allowing the actions can call the API successfully. For example, if an IAM user queries the list of CS jobs using an API, the user must have been granted permissions that allow the cs:jobs:list action.

Supported Actions

Actions supported by policies are specific to APIs. The following are common concepts related to policies:

  • Permissions: Defined by actions in a custom policy.
  • Actions: Added to a custom policy to control permissions for specific operations.
  • Authorization Scope: A custom policy can be applied to IAM projects or enterprise projects or both. Policies that contain actions supporting both IAM and enterprise projects can be assigned to user groups and take effect in both IAM and Enterprise Management. Policies that only contain actions supporting IAM projects can be assigned to user groups and only take effect for IAM. Such policies will not take effect if they are assigned to user groups in Enterprise Project. For details about the differences between IAM and enterprise projects, see What Are the Differences Between IAM and Enterprise Management?.
  • APIs: REST APIs that can be called in a custom policy.

CS supports the following actions that can be defined in custom policies:

Table 1 API actions

Permission

Action

Authorization Scope

API

Obtaining Details About a Job

cs:jobs:get

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/job/{job_id}

Obtains the Job List

cs:jobs:list

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/jobs

Creating a Job

cs:jobs:create

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

Creating a SQL job:

POST /v1.0/{project_id}/sql_job

Creating a user-defined job:

POST /v1.0/{project_id}/jar_job

Updating a Job

cs:jobs:update

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

Updating a SQL job:

PATCH /v1.0/{project_id}/sql_job

Updating a user-defined job:

PATCH /v1.0/{project_id}/jar_job

Deleting a Job

cs:jobs:delete

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

DELETE /v1.0/{project_id}/job/{job_id}

Starting a Job

cs:jobs:start

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

POST /v1.0/{project_id}/job/{job_id}/run

Stopping a Job

cs:jobs:stop

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

POST /v1.0/{project_id}/job/{job_id}/stop

Obtaining Details About a Cluster

cs:clusters:get

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/reserved_cluster/{cluster_id}

Obtaining the Cluster List

cs:clusters:list

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/reserved_clusters

Creating a Cluster

cs:clusters:create

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

POST /v1.0/{project_id}/reserved_cluster

Updating a Cluster

cs:clusters:update

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

PATCH /v1.0/{project_id}/reserved_cluster/{cluster_id}

Stopping a Cluster

cs:clusters:stop

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

POST /v1.0/{project_id}/reserved_cluster/{cluster_id}/stop

Restarting a Cluster

cs:clusters:restart

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

POST /v1.0/{project_id}/reserved_cluster/{cluster_id}/restart

Deleting a Cluster

cs:clusters:delete

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

DELETE /v1.0/{project_id}/reserved_cluster/{cluster_id}

Querying Quota Information About a User

cs:clusterQuota:get

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/user_quota/{user_id}

Querying Quota Information About all Users

cs:clusterQuota:list

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/user_quotas

Modifying User Quotas

cs:clusterQuota:modify

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

PATCH /v1.0/{project_id}/user_quota/{user_id}

Obtains Auditing Information

cs:auditLog:get

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/audit_logs?resource_type=job

Obtaining the Template List

cs:template:list

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

GET /v1.0/{project_id}/job_templates

Creating a Template

cs:template:create

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

POST /v1.0/{project_id}/job_template

Updating Information About a Template

cs:template:update

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

PATCH /v1.0/{project_id}/job_template

Deleting a Template

cs:template:delete

  • Supported:

    Projects

    Enterprise projects

  • Not supported: none

DELETE /v1.0/{project_id}/job_template/{template_id}