enterpriseprojects

package
v0.0.0-...-9b3c2d9 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 1 Imported by: 32

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 Action

func Action(client *golangsdk.ServiceClient, opts ActionOpts, id string) (r ActionResult)

Update accepts a ActionOpts struct and uses the values to enable or diaable a enterprise project.

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"`
	// A description can contain a maximum of 512 characters.
	Description string `json:"description"`
	// Specifies the enterprise project type.
	// The options are as follows:
	// poc: indicates a test project.
	// prod: indicates a commercial project.
	Type string `json:"type,omitempty"`
}

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  []Resource `json:"resources"`
	Errors     []Errors   `json:"errors"`
	TotalCount int32      `json:"total_count"`
}

func ListAssociatedResources

func ListAssociatedResources(client *golangsdk.ServiceClient, opts ListResourcesOpts) (*FilterResult, error)

ListAssociatedResources is a method that used to query associated resources for specified enterprise project using given parameters.

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"`
	Status  int    `q:"status"`
	Type    string `q:"type"`
	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 ListResourcesOpts

type ListResourcesOpts struct {
	// Target enterprise project ID.
	EnterpriseProjectId string `json:"-" required:"true"`

	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 ListResult

type ListResult struct {
	golangsdk.Result
}

func List

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"`
	Status      int    `json:"status"`
	CreatedAt   string `json:"created_at"`
	UpdatedAt   string `json:"updated_at"`
	Type        string `json:"type"`
}

type Projects

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

type Resource

type Resource 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 ResourceResult

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

func (ResourceResult) Extract

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

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