Documentation ¶
Index ¶
- Variables
- func ListDataPermissionUrl(c *golangsdk.ServiceClient) string
- type CommonResp
- type DataPermission
- type DataPermissions
- type DatabasePermissions
- type GrantDataPermissionOpts
- type GrantQueuePermissionOpts
- type ListDataPermissionOpts
- type Privilege
- type QueuePermissions
- type TablePermissions
- type TablePermissionsOfUser
- type TablePrivilege
- type TablePrivilegeOfUser
Constants ¶
This section is empty.
Variables ¶
View Source
var RequestOpts = golangsdk.RequestOpts{ MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"}, }
Functions ¶
func ListDataPermissionUrl ¶
func ListDataPermissionUrl(c *golangsdk.ServiceClient) string
GET /v1.0/{project_id}/authorization/privileges
Types ¶
type CommonResp ¶
func GrantDataPermission ¶
func GrantDataPermission(c *golangsdk.ServiceClient, opts GrantDataPermissionOpts) (*CommonResp, error)
func GrantQueuePermission ¶
func GrantQueuePermission(c *golangsdk.ServiceClient, opts GrantQueuePermissionOpts) (*CommonResp, error)
type DataPermission ¶
type DataPermission struct { // Data objects to be assigned. If they are named: // databases.Database_name, data in the entire database will be shared. // databases.Database_name.tables.Table_name, data in the specified table will be shared. // databases.Database_name.tables.Table_name.columns.Column_name, data in the specified column will be shared. // jobs.flink.Flink job ID, data the specified job will be shared. // groups. Package group name, data in the specified package group will be shared. // resources. Package name, data in the specified package will be shared. Object string `json:"object" required:"true"` // List of permissions to be granted, revoked, or updated. // NOTE: // If Action is Update and the update list is empty, all permissions of the user in the database or table // are revoked. Privileges []string `json:"privileges" required:"true"` }
type DataPermissions ¶
type DataPermissions struct { IsSuccess bool `json:"is_success"` Message string `json:"message"` ObjectName string `json:"object_name"` ObjectType string `json:"object_type"` Count int `json:"count"` Privileges []Privilege `json:"privileges"` }
func ListDataPermission ¶
func ListDataPermission(c *golangsdk.ServiceClient, opts ListDataPermissionOpts) (*DataPermissions, error)
type DatabasePermissions ¶
type DatabasePermissions struct { IsSuccess bool `json:"is_success"` Message string `json:"message"` DatabaseName string `json:"database_name"` Privileges []Privilege `json:"privileges"` }
func ListDatabasePermission ¶
func ListDatabasePermission(c *golangsdk.ServiceClient, databaseName string) (*DatabasePermissions, error)
type GrantDataPermissionOpts ¶
type GrantDataPermissionOpts struct { UserName string `json:"user_name" required:"true"` // Grants or revokes the permission. The parameter value can be grant, revoke, or update. // grant: Indicates to grant users with permissions. // revoke: Indicates to revoke permissions. // update: Indicates to clear all the original permissions and assign the permissions in the provided // permission array. // NOTE: // Users can perform the update operation only when they have been granted with the grant and revoke permissions. Action string `json:"action" required:"true"` // Permission granting information. For details, see Table 3. Privileges []DataPermission `json:"privileges" required:"true"` }
type GrantQueuePermissionOpts ¶
type GrantQueuePermissionOpts struct { QueueName string `json:"queue_name" required:"true"` UserName string `json:"user_name" required:"true"` // Grants or revokes the permission. The parameter value can be grant, revoke, or update. // grant: Indicates to grant users with permissions. // revoke: Indicates to revoke permissions. // update: Indicates to clear all the original permissions and assign the permissions in the provided // permission array. Action string `json:"action" required:"true"` // List of permissions to be granted, revoked, or updated. The following permissions are supported: // SUBMIT_JOB: indicates to submit a job. // CANCEL_JOB: indicates to cancel a job. // DROP_QUEUE: indicates to a delete a queue. // GRANT_PRIVILEGE: indicates to assign a permission. // REVOKE_PRIVILEGE: indicates to revoke a permission. // SHOW_PRIVILEGE: indicates to view other user's permissions. // RESTART: indicates to restart the queue. // SCALE_QUEUE: indicates to change the queue specifications. // NOTE: // If the update list is empty, all permissions of the queue granted to the user are revoked. Privileges []string `json:"privileges" required:"true"` }
type ListDataPermissionOpts ¶
type ListDataPermissionOpts struct { // Data object to be assigned, which corresponds to the object in API permission assignment. // "jobs.flink.job_ID", data in the specified job will be queried. // "groups.Package_group_name", data in the specified package group will be queried. // "resources.Package_ame", data in the specified package will be queried. // NOTE: // When you view the packages in a group, the object format is resources.package group name/package name. Object string `q:"object"` Limit int `q:"limit"` Offset int `q:"offset"` }
type QueuePermissions ¶
type QueuePermissions struct { IsSuccess bool `json:"is_success"` Message string `json:"message"` QueueName string `json:"queue_name"` Privileges []Privilege `json:"privileges"` }
func ListQueuePermission ¶
func ListQueuePermission(c *golangsdk.ServiceClient, queueName string) (*QueuePermissions, error)
type TablePermissions ¶
type TablePermissions struct { IsSuccess bool `json:"is_success"` Message string `json:"message"` Privileges []TablePrivilege `json:"privileges"` }
func ListTablePermission ¶
func ListTablePermission(c *golangsdk.ServiceClient, databaseName string, tableName string) (*TablePermissions, error)
type TablePermissionsOfUser ¶
type TablePermissionsOfUser struct { IsSuccess bool `json:"is_success"` Message string `json:"message"` UserName string `json:"user_name"` Privileges []TablePrivilegeOfUser `json:"privileges"` }
func GetTablePermissionOfUser ¶
func GetTablePermissionOfUser(c *golangsdk.ServiceClient, dbName string, tableName string, userName string) ( *TablePermissionsOfUser, error)
type TablePrivilege ¶
type TablePrivilege struct { IsAdmin bool `json:"is_admin"` // Objects on which a user has permission. // If the object is in the format of databases.Database name.tables.Table name, // the user has permission on the database. // If the object is in the format of databases.Database name.tables.Table namecolumns.Column name, // the user has permission on the table. Object string `json:"object"` Privileges []string `json:"privileges"` UserName string `json:"user_name"` }
type TablePrivilegeOfUser ¶
Click to show internal directories.
Click to hide internal directories.