enterpriseprojects

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

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

This section is empty.

Types

type ActionOpts

type ActionOpts struct {
	// enable: Enable an enterprise project.
	// disable: Disable an enterprise project.
	Action string `json:"action" required:"true"`
}

type ActionResult

type ActionResult struct {
	// contains filtered or unexported fields
}

func (ActionResult) Extract

func (r ActionResult) Extract() (Project, error)

type CreatResult

type CreatResult struct {
	// contains filtered or unexported fields
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (r CreatResult)

Create accepts a CreateOpts struct and uses the values to create a new enterprise project.

func (CreatResult) Extract

func (r CreatResult) Extract() (Project, error)

type CreateOpts

type CreateOpts struct {
	// A name can contain 1 to 64 characters.
	// Only letters, digits, underscores (_), and hyphens (-) are allowed.
	// The name must be unique in the domain and cannot include any form of
	// the word "default" ("deFaulT", for instance).
	Name string `json:"name" required:"true"`
	//Resource set. The value can contain 1 to 36 characters,
	//including only lowercase letters, digits, and hyphens (-).
	ProjectId string `json:"project_id" required:"true"`
	// A description can contain a maximum of 512 characters.
	Description string `json:"description"`
}

CreateOpts allows to create a enterprise project using given parameters.

type Errors

type Errors struct {
	ErrorCode string `json:"error_code,omitempty"`

	ErrorMsg string `json:"error_msg,omitempty"`

	ProjectId string `json:"project_id,omitempty"`

	ResourceType string `json:"resource_type,omitempty"`
}

type FilterResult

type FilterResult struct {
	Resources  []Resources `json:"resources"`
	Errors     []Errors    `json:"errors"`
	TotalCount int32       `json:"total_count"`
}

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

func Get

func Get(client *golangsdk.ServiceClient, id string) (r GetResult)

Get is a method to obtain the specified enterprise project by id.

func (GetResult) Extract

func (r GetResult) Extract() (Project, error)

type ListOpts

type ListOpts struct {
	Name           string `q:"name"`
	ID             string `q:"id"`
	IDs            string `q:"ids"`
	DomainId       string `q:"domain_id"`
	VdcId          string `q:"vdc_id"`
	Inherit        bool   `q:"inherit"`
	ProjectId      string `q:"project_id"`
	Type           string `q:"type"`
	Status         int    `q:"status"`
	QueryType      string `q:"query_type"`
	AuthAction     string `q:"auth_action"`
	ContainDefault bool   `q:"contain_default"`
	Offset         string `q:"offset"`
	Limit          string `q:"limit"`
	SortKey        string `q:"sort_key"`
	SortDir        string `q:"sort_dir"`
}

func (ListOpts) ToEnterpriseProjectListQuery

func (opts ListOpts) ToEnterpriseProjectListQuery() (string, error)

type ListOptsBuilder

type ListOptsBuilder interface {
	ToEnterpriseProjectListQuery() (string, error)
}

type ListResult

type ListResult struct {
	golangsdk.Result
}

func List

func List(c *golangsdk.ServiceClient, opts ListOptsBuilder) (r ListResult)

func (ListResult) Extract

func (r ListResult) Extract() ([]Project, error)

type Match

type Match struct {
	Key string `json:"key" required:"true"`

	Value string `json:"value" required:"true"`
}

type MigrateResourceOpts

type MigrateResourceOpts struct {
	ResourceId string `json:"resource_id" required:"true"`

	ResourceType string `json:"resource_type" required:"true"`
	// this filed is required when resource_type is bucket
	RegionId string `json:"region_id,omitempty"`

	// this filed is required when resource_type is region level
	ProjectId string `json:"project_id,omitempty"`

	// only support for EVS、EIP
	Associated *bool `json:"associated,omitempty"`
}

type MigrateResult

type MigrateResult struct {
	// contains filtered or unexported fields
}

func Migrate

func Migrate(client *golangsdk.ServiceClient, opts MigrateResourceOpts, id string) (r MigrateResult)

func (MigrateResult) Extract

func (r MigrateResult) Extract() (Project, error)

type Project

type Project struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	DeleteFlag  bool   `json:"delete_flag"`
	Status      int    `json:"status"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
	DomainId    string `json:"domain_id"`
	VdcId       string `json:"vdc_id"`
	ProjectId   string `json:"project_id"`
	DomainName  string `json:"domain_name"`
	VdcName     string `json:"vdc_name"`
	ProjectName string `json:"project_name"`
}

type Projects

type Projects struct {
	EnterpriseProjects []Project `json:"enterprise_projects"`
	TotalCount         int       `json:"total_count"`
}

type ResourceOpts

type ResourceOpts struct {
	ResourceTypes []string `json:"resource_types" required:"true"`

	Projects []string `json:"projects,omitempty"`

	Offset int32 `json:"offset,omitempty"`

	Limit int32 `json:"limit,omitempty"`

	Matches []Match `json:"matches,omitempty"`
}

type ResourceResult

type ResourceResult struct {
	// contains filtered or unexported fields
}

func (ResourceResult) Extract

func (r ResourceResult) Extract() (Project, error)

type Resources

type Resources struct {
	EnterpriseProjectId string `json:"enterprise_project_id"`

	ProjectId string `json:"project_id"`

	ProjectName string `json:"project_name"`

	ResourceDetail interface{} `json:"-"`

	ResourceId string `json:"resource_id"`

	ResourceName string `json:"resource_name"`

	ResourceType string `json:"resource_type"`
}

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

func Update

func Update(client *golangsdk.ServiceClient, opts CreateOpts, id string) (r UpdateResult)

Update accepts a CreateOpts struct and uses the values to Update a enterprise project.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (Project, error)

Jump to

Keyboard shortcuts

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