resources

package
v0.0.0-...-e794f14 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 2 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

Types

type ListOpts

type ListOpts struct {
	Region              string `q:"region_id"`
	EnterpriseProjectId string `q:"ep_id"`
	// provider.type
	Type string `q:"type"`
	// min:1
	// max:200
	Limit int `q:"limit"`
	// min:4
	// max:400
	Marker string `q:"marker"`
}

type ListResp

type ListResp struct {
	Resources []Resource `json:"resources"`
	PageInfo  PageInfo   `json:"page_info"`
}

type PageInfo

type PageInfo struct {
	CurrentCount int    `json:"current_count"`
	NextMarker   string `json:"next_marker"`
}

type Resource

type Resource struct {
	Id                string                 `json:"id"`
	Name              string                 `json:"name"`
	Provider          string                 `json:"provider"`
	Type              string                 `json:"type"`
	RegionId          string                 `json:"region_id"`
	ProjectId         string                 `json:"project_id"`
	ProjectName       string                 `json:"project_name"`
	EpId              string                 `json:"ep_id"`
	EpName            string                 `json:"ep_name"`
	Checksum          string                 `json:"checksum"`
	Created           string                 `json:"created"`
	Updated           string                 `json:"updated"`
	ProvisioningState string                 `json:"provisioning_state"`
	Tags              map[string]string      `json:"tags"`
	Properties        map[string]interface{} `json:"properties"`
}

func ExtractResources

func ExtractResources(r pagination.Page) ([]Resource, error)

ExtractResources accepts a Page struct, specifically a ResourcePage struct, and extracts the elements into a slice of Resource structs.

type ResourcePage

type ResourcePage struct {
	pagination.MarkerPageBase
}

ResourcePage is the page returned by a pager when traversing over a collection of route tables

func (ResourcePage) IsEmpty

func (r ResourcePage) IsEmpty() (bool, error)

IsEmpty checks whether a ResourcePage struct is empty.

func (ResourcePage) LastMarker

func (r ResourcePage) LastMarker() (string, error)

LastMarker returns the last resource ID in a ListResult

Jump to

Keyboard shortcuts

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