query

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCount

func GetCount(client *golangsdk.ServiceClient, domainId string, opts CountOpts) (*int, error)

Types

type CountOpts

type CountOpts struct {
	// Specifies the region ID.
	RegionId string `q:"region_id"`
	// Specifies the project ID.
	ProjectId string `q:"project_id"`
	// Specifies the resource type
	Type string `q:"type"`
	// Specifies the resource ID.
	Id string `q:"id"`
	// Specifies the resource name.
	Name string `q:"name"`
	// Specifies tags. The format is key or key=value.
	Tags []string `q:"tags"`
}

type ListAllOpts

type ListAllOpts struct {
	// Specifies the maximum number of resources to return.
	Limit *int `q:"limit"`
	// Specifies the pagination parameter.
	Marker string `q:"marker"`
	// Specifies the region ID.
	RegionId string `q:"region_id"`
	// Specifies the resource type
	Type string `q:"type"`
	// Specifies the resource ID.
	Id string `q:"id"`
	// Specifies the resource name.
	Name string `q:"name"`
	// Specifies tags. The format is key or key=value.
	Tags []string `q:"tags"`
}

type ListAllTagsOpts

type ListAllTagsOpts struct {
	// Specifies the maximum number of resources to return.
	Limit *int `q:"limit"`
	// Specifies the pagination parameter.
	Marker string `q:"marker"`
	// Specifies the name of the tag key.
	Key string `q:"key"`
}

type ListRecordedOpts

type ListRecordedOpts struct {
	// Specifies the maximum number of resources to return.
	Limit *int `q:"limit"`
	// Specifies the pagination parameter.
	Marker string `q:"marker"`
	// Specifies the region ID.
	RegionId string `q:"region_id"`
	// Specifies the resource type
	Type string `q:"type"`
	// Specifies the resource ID.
	Id string `q:"id"`
	// Specifies the resource name.
	Name string `q:"name"`
	// Specifies tags. The format is key or key=value.
	Tags []string `q:"tags"`
	// Indicating whether deleted resources need to be returned.
	// This parameter is set to false by default.
	ResourceDeleted *bool `q:"resource_deleted"`
}

type ListRecordedSummaryOpts

type ListRecordedSummaryOpts struct {
	// Specifies the resource name.
	Name string `q:"name"`
	// Specifies the resource type
	Type string `q:"type"`
	// Specifies the region ID.
	RegionId string `q:"region_id"`
	// Specifies the project ID.
	ProjectId string `q:"project_id"`
	// Specifies tags. The format is key or key=value.
	Tags []string `q:"tags"`
	// Indicating whether deleted resources need to be returned.
	// This parameter is set to false by default.
	ResourceDeleted *bool `q:"resource_deleted"`
}

type ListRecordedTagsOpts

type ListRecordedTagsOpts struct {
	// Specifies the maximum number of resources to return.
	Limit *int `q:"limit"`
	// Specifies the pagination parameter.
	Marker string `q:"marker"`
	// Specifies the name of the tag key.
	Key string `q:"key"`
	// Indicating whether deleted resources need to be returned.
	// This parameter is set to false by default.
	ResourceDeleted *bool `q:"resource_deleted"`
}

type ListServicesOpts

type ListServicesOpts struct {
	// Specifies the number of records returned on each page during pagination query.
	Limit *int `q:"limit"`
	// Specifies the pagination offset.
	Offset *int `q:"offset"`
	// Specifies whether resources are collected by default. tracked indicates that resources are collected by default,
	// and untracked indicates that resources are not collected by default.
	Track string `q:"track"`
}

type ListSpecificOpts

type ListSpecificOpts struct {
	// Specifies the number of records returned on each page during pagination query.
	Limit *int `q:"limit"`
	// Specifies the start flag for querying the current page. If this parameter is left blank, the first page is queried.
	// The marker for querying the next page is the next_marker in the page_info object returned on the current page.
	Marker string `q:"marker"`
	// Specifies the region ID.
	RegionId string `q:"region_id"`
	// Specifies the tag.
	Tag map[string]string `q:"tag"`
}

type ListSummaryOpts

type ListSummaryOpts struct {
	// Specifies the resource name.
	Name string `q:"name"`
	// Specifies the resource type
	Type string `q:"type"`
	// Specifies the region ID.
	RegionId string `q:"region_id"`
	// Specifies the project ID.
	ProjectId string `q:"project_id"`
	// Specifies tags. The format is key or key=value.
	Tags []string `q:"tags"`
}

type Regions

type Regions struct {
	// Specifies the region ID.
	RegionId string `json:"region_id"`
	// Specifies the number of resources of this type in the current region.
	Count int `json:"count"`
}

type ResPage

type ResPage struct {
	pagination.NewSinglePageBase
}

type Resource

type Resource struct {
	// Specifies the resource ID.
	ID string `json:"id"`
	// Specifies the resource name.
	Name string `json:"name"`
	// Specifies the cloud service name.
	Service string `json:"provider"`
	// Specifies the resource type.
	Type string `json:"type"`
	// Specifies the region ID.
	RegionId string `json:"region_id"`
	// Specifies the project ID in IaaS OpenStack.
	ProjectId string `json:"project_id"`
	// Specifies the project name in IaaS OpenStack.
	ProjectName string `json:"project_name"`
	// Specifies the resource checksum.
	Checksum string `json:"checksum"`
	// Specifies the time when the resource was created.
	CreatedAt string `json:"created"`
	// Specifies the time when the resource was updated.
	UpdatedAt string `json:"updated"`
	// Specifies the status of a resource operation.
	ProvisioningState string `json:"provisioning_state"`
	// Resource state. The value can be normal or deleted.
	State string `json:"state"`
	// Specifies the resource tag.
	Tags map[string]string `json:"tags"`
	// Specifies the detailed properties of the resource.
	Properties map[string]interface{} `json:"properties"`
}

func ExtractResources

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

func GetAnyResource

func GetAnyResource(client *golangsdk.ServiceClient, domainId, id string) (*Resource, error)

func GetRecordedResource

func GetRecordedResource(client *golangsdk.ServiceClient, domainId, id string) (*Resource, error)

func GetResource

func GetResource(client *golangsdk.ServiceClient, domainId, service, resourceType, id string) (*Resource, error)

func ListAllResources

func ListAllResources(client *golangsdk.ServiceClient, domainId string, opts ListAllOpts) ([]Resource, error)

func ListRecordedResources

func ListRecordedResources(client *golangsdk.ServiceClient, domainId string, opts ListRecordedOpts) ([]Resource, error)

func ListSpecificType

func ListSpecificType(client *golangsdk.ServiceClient, domainId, service, resourceType string, opts ListSpecificOpts) ([]Resource, error)

type ResourceTypes

type ResourceTypes struct {
	// Specifies the resource type.
	Name string `json:"name"`
	// Specifies the display name of the resource type.
	DisplayName string `json:"display_name"`
	// Specifies whether the resource is a global resource.
	Global bool `json:"global"`
	// Specifies the list of supported regions.
	Regions []string `json:"regions"`
	// Specifies the console endpoint ID.
	ConsoleEndpointId string `json:"console_endpoint_id"`
	// Specifies the URL of the resource list page on the console.
	ConsoleListUrl string `json:"console_list_url"`
	// Specifies the URL of the resource details page on the console.
	ConsoleDetailUrl string `json:"console_detail_url"`
	// Specifies whether resources are collected by default.
	// tracked indicates that resources are collected by default,
	// and untracked indicates that resources are not collected by default.
	Track string `json:"track"`
}

type Service

type Service struct {
	// Specifies the cloud service name.
	ServiceName string `json:"provider"`
	// Specifies the display name of the cloud service.
	// You can set the language by configuring X-Language in the request header.
	DisplayName string `json:"display_name"`
	// Specifies the display name of the cloud service type.
	// You can set the language by configuring X-Language in the request header.
	CategoryDisplayName string `json:"category_display_name"`
	// Specifies the resource type list.
	ResourceTypes []ResourceTypes `json:"resource_types"`
}

func ExtractServices

func ExtractServices(r pagination.NewPage) ([]Service, error)

func ListServices

func ListServices(client *golangsdk.ServiceClient, domainId string, opts ListServicesOpts) ([]Service, error)

type ServicesPage

type ServicesPage struct {
	pagination.NewSinglePageBase
}

type Summary

type Summary struct {
	// Specifies the cloud service name.
	Provider string `json:"provider"`
	// Specifies the resource type list.
	Types []Types `json:"types"`
}

func ExtractSummary

func ExtractSummary(r pagination.NewPage) ([]Summary, error)

func ListRecordedResourcesSummary

func ListRecordedResourcesSummary(client *golangsdk.ServiceClient, domainId string, opts ListRecordedSummaryOpts) ([]Summary, error)

func ListResourcesSummary

func ListResourcesSummary(client *golangsdk.ServiceClient, domainId string, opts ListSummaryOpts) ([]Summary, error)

type SummaryPage

type SummaryPage struct {
	pagination.NewSinglePageBase
}

type Tag

type Tag struct {
	// Specifies the tag key.
	Key string `json:"key"`
	// Specifies tag values.
	Value []string `json:"value"`
}

func ExtractTags

func ExtractTags(r pagination.NewPage) ([]Tag, error)

func ListAllResourcesTags

func ListAllResourcesTags(client *golangsdk.ServiceClient, domainId string, opts ListAllTagsOpts) ([]Tag, error)

func ListRecordedResourcesTags

func ListRecordedResourcesTags(client *golangsdk.ServiceClient, domainId string, opts ListRecordedTagsOpts) ([]Tag, error)

type TagsPage

type TagsPage struct {
	pagination.NewSinglePageBase
}

type Types

type Types struct {
	// Specifies the resource type.
	Type string `json:"type"`
	// Specifies the regions.
	Regions []Regions `json:"regions"`
}

Jump to

Keyboard shortcuts

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