Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions openstack/evs/v3/volumes/requests.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package volumes

import (
"github.com/huaweicloud/golangsdk"
)

// Get retrieves the Volume with the provided ID. To extract the Volume object
// from the response, call the Extract method on the GetResult.
func Get(client *golangsdk.ServiceClient, id string) (r GetResult) {
_, r.Err = client.Get(getURL(client, id), &r.Body, nil)
return
}
34 changes: 34 additions & 0 deletions openstack/evs/v3/volumes/results.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package volumes

import (
"github.com/huaweicloud/golangsdk"
)

// Volume contains all the information associated with a Volume.
type Volume struct {
// Unique identifier for the volume.
ID string `json:"id"`
// wwn of the volume.
WWN string `json:"wwn"`
}

type commonResult struct {
golangsdk.Result
}

// Extract will get the Volume object out of the commonResult object.
func (r commonResult) Extract() (*Volume, error) {
var s Volume
err := r.ExtractInto(&s)
return &s, err
}

// ExtractInto converts our response data into a volume struct
func (r commonResult) ExtractInto(v interface{}) error {
return r.Result.ExtractIntoStructPtr(v, "volume")
}

// GetResult contains the response body and error from a Get request.
type GetResult struct {
commonResult
}
7 changes: 7 additions & 0 deletions openstack/evs/v3/volumes/urls.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package volumes

import "github.com/huaweicloud/golangsdk"

func getURL(c *golangsdk.ServiceClient, id string) string {
return c.ServiceURL("os-vendor-volumes", id)
}
2 changes: 0 additions & 2 deletions openstack/objectstorage/v1/accounts/testing/doc.go

This file was deleted.

57 changes: 0 additions & 57 deletions openstack/objectstorage/v1/accounts/testing/fixtures.go

This file was deleted.

82 changes: 0 additions & 82 deletions openstack/objectstorage/v1/accounts/testing/requests_test.go

This file was deleted.

2 changes: 0 additions & 2 deletions openstack/objectstorage/v1/containers/testing/doc.go

This file was deleted.

155 changes: 0 additions & 155 deletions openstack/objectstorage/v1/containers/testing/fixtures.go

This file was deleted.

Loading