MCPcopy
hub / github.com/lxc/incus / GetStoragePoolVolumesAllProjects

Method GetStoragePoolVolumesAllProjects

client/incus_storage_volumes.go:106–130  ·  view source on GitHub ↗

GetStoragePoolVolumesAllProjects returns a list of StorageVolume entries for the provided pool for all projects.

(pool string)

Source from the content-addressed store, hash-verified

104
105// GetStoragePoolVolumesAllProjects returns a list of StorageVolume entries for the provided pool for all projects.
106func (r *ProtocolIncus) GetStoragePoolVolumesAllProjects(pool string) ([]api.StorageVolume, error) {
107 err := r.CheckExtension("storage")
108 if err != nil {
109 return nil, err
110 }
111
112 err = r.CheckExtension("storage_volumes_all_projects")
113 if err != nil {
114 return nil, err
115 }
116
117 volumes := []api.StorageVolume{}
118
119 uri := api.NewURL().Path("storage-pools", pool, "volumes").
120 WithQuery("recursion", "1").
121 WithQuery("all-projects", "true")
122
123 // Fetch the raw value.
124 _, err = r.queryStruct("GET", uri.String(), nil, "", &volumes)
125 if err != nil {
126 return nil, err
127 }
128
129 return volumes, nil
130}
131
132// GetStoragePoolVolumesWithFilter returns a filtered list of StorageVolume entries for the provided pool.
133func (r *ProtocolIncus) GetStoragePoolVolumesWithFilter(pool string, filters []string) ([]api.StorageVolume, error) {

Callers

nothing calls this directly

Calls 6

CheckExtensionMethod · 0.95
queryStructMethod · 0.95
NewURLFunction · 0.92
WithQueryMethod · 0.80
PathMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected