GetStoragePoolVolumesAllProjects returns a list of StorageVolume entries for the provided pool for all projects.
(pool string)
| 104 | |
| 105 | // GetStoragePoolVolumesAllProjects returns a list of StorageVolume entries for the provided pool for all projects. |
| 106 | func (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. |
| 133 | func (r *ProtocolIncus) GetStoragePoolVolumesWithFilter(pool string, filters []string) ([]api.StorageVolume, error) { |
nothing calls this directly
no test coverage detected