organizations

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (err error)

func CreatePermissions

func CreatePermissions(client *golangsdk.ServiceClient, organization string, opts []Auth) (err error)

func Delete

func Delete(client *golangsdk.ServiceClient, namespace string) (err error)

func DeletePermissions

func DeletePermissions(client *golangsdk.ServiceClient, organization string, userID string) (err error)

func UpdatePermissions

func UpdatePermissions(client *golangsdk.ServiceClient, organization string, opts []Auth) (err error)

Types

type Auth

type Auth struct {
	// User ID, which needs to be obtained from the IAM service.
	UserID string `json:"user_id"`
	// Username, which needs to be obtained from the IAM service.
	Username string `json:"user_name"`
	// User permission
	// 7: Manage
	// 3: Write
	// 1: Read
	Auth int `json:"auth"`
}

type CreateOpts

type CreateOpts struct {
	// Organization name.
	// Enter 1 to 64 characters, starting with a lowercase letter and ending with a lowercase letter or digit. Only lowercase letters, digits, periods (.), underscores (_), and hyphens (-) are allowed. Periods, underscores, and hyphens cannot be placed next to each other. A maximum of two consecutive underscores are allowed.
	Namespace string `json:"namespace"`
}

type ListOpts

type ListOpts struct {
	// Organization name
	Namespace string `q:"namespace"`
}

type Organization

type Organization struct {
	// Organization ID
	ID int `json:"id"`
	// Organization name
	Name string `json:"name"`
	// IAM username
	CreatorName string `json:"creator_name"`
	// User permission
	// 7: Manage
	// 3: Write
	// 1: Read
	Auth int `json:"auth"`
}

func Get

func Get(client *golangsdk.ServiceClient, id string) (*Organization, error)

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Organization, error)

type Permissions added in v0.5.27

type Permissions struct {
	// Permission ID.
	ID int `json:"id"`
	// Organization name.
	Name string `json:"name"`
	// Organization creator.
	CreatorName string `json:"creator_name"`
	// Permissions of the current user.
	SelfAuth Auth `json:"self_auth"`
	// Permissions of other users.
	OthersAuth []Auth `json:"others_auths"`
}

func GetPermissions

func GetPermissions(client *golangsdk.ServiceClient, organization string) (*Permissions, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL