From eb19b362fa756d31be8efc3484127e16d37c0062 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 22 Feb 2024 18:13:48 +0000 Subject: [PATCH] Rename imageservice -> image To align with other services. Signed-off-by: Stephen Finucane --- ...l-imageservice.yaml => functional-image.yaml} | 12 ++++++------ internal/acceptance/clients/clients.go | 6 +++--- .../{imageservice => image}/v2/imagedata_test.go | 2 +- .../v2/imageimport_test.go | 8 ++++---- .../{imageservice => image}/v2/images_test.go | 16 ++++++++-------- .../{imageservice => image}/v2/imageservice.go | 16 ++++++++-------- .../{imageservice => image}/v2/tasks_test.go | 14 +++++++------- openstack/client.go | 6 +++--- openstack/{imageservice => image}/v2/README.md | 0 .../{imageservice => image}/v2/imagedata/doc.go | 0 .../v2/imagedata/requests.go | 2 +- .../v2/imagedata/results.go | 0 .../v2/imagedata/testing/doc.go | 0 .../v2/imagedata/testing/fixtures_test.go | 0 .../v2/imagedata/testing/requests_test.go | 2 +- .../{imageservice => image}/v2/imagedata/urls.go | 0 .../v2/imageimport/doc.go | 2 +- .../v2/imageimport/requests.go | 0 .../v2/imageimport/results.go | 0 .../v2/imageimport/testing/doc.go | 0 .../v2/imageimport/testing/fixtures_test.go | 0 .../v2/imageimport/testing/requests_test.go | 2 +- .../v2/imageimport/urls.go | 0 .../{imageservice => image}/v2/images/doc.go | 0 .../v2/images/requests.go | 0 .../{imageservice => image}/v2/images/results.go | 2 +- .../v2/images/testing/doc.go | 0 .../v2/images/testing/fixtures_test.go | 0 .../v2/images/testing/requests_test.go | 2 +- .../{imageservice => image}/v2/images/types.go | 0 .../{imageservice => image}/v2/images/urls.go | 0 .../{imageservice => image}/v2/members/doc.go | 0 .../v2/members/requests.go | 0 .../v2/members/results.go | 0 .../v2/members/testing/doc.go | 0 .../v2/members/testing/fixtures_test.go | 0 .../v2/members/testing/requests_test.go | 2 +- .../{imageservice => image}/v2/members/urls.go | 0 .../{imageservice => image}/v2/tasks/doc.go | 2 +- .../{imageservice => image}/v2/tasks/requests.go | 8 ++++---- .../{imageservice => image}/v2/tasks/results.go | 0 .../v2/tasks/testing/doc.go | 0 .../v2/tasks/testing/fixtures_test.go | 2 +- .../v2/tasks/testing/requests_test.go | 2 +- .../{imageservice => image}/v2/tasks/urls.go | 0 45 files changed, 54 insertions(+), 54 deletions(-) rename .github/workflows/{functional-imageservice.yaml => functional-image.yaml} (89%) rename internal/acceptance/openstack/{imageservice => image}/v2/imagedata_test.go (93%) rename internal/acceptance/openstack/{imageservice => image}/v2/imageimport_test.go (76%) rename internal/acceptance/openstack/{imageservice => image}/v2/images_test.go (91%) rename internal/acceptance/openstack/{imageservice => image}/v2/imageservice.go (89%) rename internal/acceptance/openstack/{imageservice => image}/v2/tasks_test.go (76%) rename openstack/{imageservice => image}/v2/README.md (100%) rename openstack/{imageservice => image}/v2/imagedata/doc.go (100%) rename openstack/{imageservice => image}/v2/imagedata/requests.go (98%) rename openstack/{imageservice => image}/v2/imagedata/results.go (100%) rename openstack/{imageservice => image}/v2/imagedata/testing/doc.go (100%) rename openstack/{imageservice => image}/v2/imagedata/testing/fixtures_test.go (100%) rename openstack/{imageservice => image}/v2/imagedata/testing/requests_test.go (96%) rename openstack/{imageservice => image}/v2/imagedata/urls.go (100%) rename openstack/{imageservice => image}/v2/imageimport/doc.go (94%) rename openstack/{imageservice => image}/v2/imageimport/requests.go (100%) rename openstack/{imageservice => image}/v2/imageimport/results.go (100%) rename openstack/{imageservice => image}/v2/imageimport/testing/doc.go (100%) rename openstack/{imageservice => image}/v2/imageimport/testing/fixtures_test.go (100%) rename openstack/{imageservice => image}/v2/imageimport/testing/requests_test.go (95%) rename openstack/{imageservice => image}/v2/imageimport/urls.go (100%) rename openstack/{imageservice => image}/v2/images/doc.go (100%) rename openstack/{imageservice => image}/v2/images/requests.go (100%) rename openstack/{imageservice => image}/v2/images/results.go (99%) rename openstack/{imageservice => image}/v2/images/testing/doc.go (100%) rename openstack/{imageservice => image}/v2/images/testing/fixtures_test.go (100%) rename openstack/{imageservice => image}/v2/images/testing/requests_test.go (99%) rename openstack/{imageservice => image}/v2/images/types.go (100%) rename openstack/{imageservice => image}/v2/images/urls.go (100%) rename openstack/{imageservice => image}/v2/members/doc.go (100%) rename openstack/{imageservice => image}/v2/members/requests.go (100%) rename openstack/{imageservice => image}/v2/members/results.go (100%) rename openstack/{imageservice => image}/v2/members/testing/doc.go (100%) rename openstack/{imageservice => image}/v2/members/testing/fixtures_test.go (100%) rename openstack/{imageservice => image}/v2/members/testing/requests_test.go (98%) rename openstack/{imageservice => image}/v2/members/urls.go (100%) rename openstack/{imageservice => image}/v2/tasks/doc.go (98%) rename openstack/{imageservice => image}/v2/tasks/requests.go (93%) rename openstack/{imageservice => image}/v2/tasks/results.go (100%) rename openstack/{imageservice => image}/v2/tasks/testing/doc.go (100%) rename openstack/{imageservice => image}/v2/tasks/testing/fixtures_test.go (98%) rename openstack/{imageservice => image}/v2/tasks/testing/requests_test.go (98%) rename openstack/{imageservice => image}/v2/tasks/urls.go (100%) diff --git a/.github/workflows/functional-imageservice.yaml b/.github/workflows/functional-image.yaml similarity index 89% rename from .github/workflows/functional-imageservice.yaml rename to .github/workflows/functional-image.yaml index 252e4b571c..d842f10591 100644 --- a/.github/workflows/functional-imageservice.yaml +++ b/.github/workflows/functional-image.yaml @@ -1,12 +1,12 @@ -name: functional-imageservice +name: functional-image on: pull_request: paths: - - '**imageservice**' + - '**image**' schedule: - cron: '0 0 */3 * *' jobs: - functional-imageservice: + functional-image: strategy: fail-fast: false matrix: @@ -36,7 +36,7 @@ jobs: openstack_version: "stable/victoria" ubuntu_version: "20.04" runs-on: ubuntu-${{ matrix.ubuntu_version }} - name: Deploy OpenStack ${{ matrix.name }} with Glance and run imageservice acceptance tests + name: Deploy OpenStack ${{ matrix.name }} with Glance and run image acceptance tests steps: - name: Checkout Gophercloud uses: actions/checkout@v4 @@ -52,7 +52,7 @@ jobs: run: ./script/acceptancetest env: DEVSTACK_PATH: ${{ github.workspace }}/devstack - ACCEPTANCE_TESTS_FILTER: "^.*imageservice.*$" + ACCEPTANCE_TESTS_FILTER: "^.*image.*$" OS_BRANCH: ${{ matrix.openstack_version }} - name: Generate logs on failure run: ./script/collectlogs @@ -61,5 +61,5 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: functional-imageservice-${{ matrix.name }} + name: functional-image-${{ matrix.name }} path: /tmp/devstack-logs/* diff --git a/internal/acceptance/clients/clients.go b/internal/acceptance/clients/clients.go index 05f45fe56d..3de05132fd 100644 --- a/internal/acceptance/clients/clients.go +++ b/internal/acceptance/clients/clients.go @@ -463,10 +463,10 @@ func NewIdentityV3UnauthenticatedClient() (*gophercloud.ServiceClient, error) { return openstack.NewIdentityV3(client, gophercloud.EndpointOpts{}) } -// NewImageServiceV2Client returns a *ServiceClient for making calls to the +// NewImageV2Client returns a *ServiceClient for making calls to the // OpenStack Image v2 API. An error will be returned if authentication or // client creation was not possible. -func NewImageServiceV2Client() (*gophercloud.ServiceClient, error) { +func NewImageV2Client() (*gophercloud.ServiceClient, error) { ao, err := openstack.AuthOptionsFromEnv() if err != nil { return nil, err @@ -479,7 +479,7 @@ func NewImageServiceV2Client() (*gophercloud.ServiceClient, error) { client = configureDebug(client) - return openstack.NewImageServiceV2(client, gophercloud.EndpointOpts{ + return openstack.NewImageV2(client, gophercloud.EndpointOpts{ Region: os.Getenv("OS_REGION_NAME"), }) } diff --git a/internal/acceptance/openstack/imageservice/v2/imagedata_test.go b/internal/acceptance/openstack/image/v2/imagedata_test.go similarity index 93% rename from internal/acceptance/openstack/imageservice/v2/imagedata_test.go rename to internal/acceptance/openstack/image/v2/imagedata_test.go index e6d43a1259..4ea210b945 100644 --- a/internal/acceptance/openstack/imageservice/v2/imagedata_test.go +++ b/internal/acceptance/openstack/image/v2/imagedata_test.go @@ -9,7 +9,7 @@ import ( ) func TestImageStage(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) image, err := CreateEmptyImage(t, client) diff --git a/internal/acceptance/openstack/imageservice/v2/imageimport_test.go b/internal/acceptance/openstack/image/v2/imageimport_test.go similarity index 76% rename from internal/acceptance/openstack/imageservice/v2/imageimport_test.go rename to internal/acceptance/openstack/image/v2/imageimport_test.go index a2b26f6832..65cef05da3 100644 --- a/internal/acceptance/openstack/imageservice/v2/imageimport_test.go +++ b/internal/acceptance/openstack/image/v2/imageimport_test.go @@ -1,5 +1,5 @@ -//go:build acceptance || imageservice || imageimport -// +build acceptance imageservice imageimport +//go:build acceptance || image || imageimport +// +build acceptance image imageimport package v2 @@ -12,7 +12,7 @@ import ( ) func TestGetImportInfo(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) importInfo, err := GetImportInfo(t, client) @@ -22,7 +22,7 @@ func TestGetImportInfo(t *testing.T) { } func TestCreateImport(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) image, err := CreateEmptyImage(t, client) diff --git a/internal/acceptance/openstack/imageservice/v2/images_test.go b/internal/acceptance/openstack/image/v2/images_test.go similarity index 91% rename from internal/acceptance/openstack/imageservice/v2/images_test.go rename to internal/acceptance/openstack/image/v2/images_test.go index 1013d66d3d..2ebe82b695 100644 --- a/internal/acceptance/openstack/imageservice/v2/images_test.go +++ b/internal/acceptance/openstack/image/v2/images_test.go @@ -1,5 +1,5 @@ -//go:build acceptance || imageservice || images -// +build acceptance imageservice images +//go:build acceptance || image || images +// +build acceptance image images package v2 @@ -11,13 +11,13 @@ import ( "github.com/gophercloud/gophercloud/v2/internal/acceptance/clients" "github.com/gophercloud/gophercloud/v2/internal/acceptance/tools" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/images" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/images" "github.com/gophercloud/gophercloud/v2/pagination" th "github.com/gophercloud/gophercloud/v2/testhelper" ) func TestImagesListEachPage(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) listOpts := images.ListOpts{ @@ -41,7 +41,7 @@ func TestImagesListEachPage(t *testing.T) { } func TestImagesListAllPages(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) image, err := CreateEmptyImage(t, client) @@ -70,7 +70,7 @@ func TestImagesListAllPages(t *testing.T) { } func TestImagesListByDate(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) date := time.Date(2014, 1, 1, 1, 1, 1, 0, time.UTC) @@ -118,7 +118,7 @@ func TestImagesListByDate(t *testing.T) { } func TestImagesFilter(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) image, err := CreateEmptyImage(t, client) @@ -143,7 +143,7 @@ func TestImagesFilter(t *testing.T) { } func TestImagesUpdate(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) image, err := CreateEmptyImage(t, client) diff --git a/internal/acceptance/openstack/imageservice/v2/imageservice.go b/internal/acceptance/openstack/image/v2/imageservice.go similarity index 89% rename from internal/acceptance/openstack/imageservice/v2/imageservice.go rename to internal/acceptance/openstack/image/v2/imageservice.go index b44526e26e..baccc68ae3 100644 --- a/internal/acceptance/openstack/imageservice/v2/imageservice.go +++ b/internal/acceptance/openstack/image/v2/imageservice.go @@ -1,4 +1,4 @@ -// Package v2 contains common functions for creating imageservice resources +// Package v2 contains common functions for creating image resources // for use in acceptance tests. See the `*_test.go` files for example usages. package v2 @@ -11,10 +11,10 @@ import ( "github.com/gophercloud/gophercloud/v2" "github.com/gophercloud/gophercloud/v2/internal/acceptance/tools" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imagedata" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imageimport" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/images" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/imagedata" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/imageimport" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/images" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks" th "github.com/gophercloud/gophercloud/v2/testhelper" ) @@ -77,7 +77,7 @@ const ImportImageURL = "http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_ // CreateTask will create a task to import the CirrOS image. // An error will be returned if a task couldn't be created. func CreateTask(t *testing.T, client *gophercloud.ServiceClient, imageURL string) (*tasks.Task, error) { - t.Logf("Attempting to create an Imageservice import task with image: %s", imageURL) + t.Logf("Attempting to create an Image service import task with image: %s", imageURL) opts := tasks.CreateOpts{ Type: "import", Input: map[string]interface{}{ @@ -104,7 +104,7 @@ func CreateTask(t *testing.T, client *gophercloud.ServiceClient, imageURL string // GetImportInfo will retrieve Import API information. func GetImportInfo(t *testing.T, client *gophercloud.ServiceClient) (*imageimport.ImportInfo, error) { - t.Log("Attempting to get the Imageservice Import API information") + t.Log("Attempting to get the Image service Import API information") importInfo, err := imageimport.Get(context.TODO(), client).Extract() if err != nil { return nil, err @@ -159,7 +159,7 @@ func DeleteImageFile(t *testing.T, filepath string) { t.Logf("Successfully deleted image file %s", filepath) } -// ImportImage will import image data from the remote source to the Imageservice. +// ImportImage will import image data from the remote source to the Image service. func ImportImage(t *testing.T, client *gophercloud.ServiceClient, imageID string) error { importOpts := imageimport.CreateOpts{ Name: imageimport.WebDownloadMethod, diff --git a/internal/acceptance/openstack/imageservice/v2/tasks_test.go b/internal/acceptance/openstack/image/v2/tasks_test.go similarity index 76% rename from internal/acceptance/openstack/imageservice/v2/tasks_test.go rename to internal/acceptance/openstack/image/v2/tasks_test.go index 1a722f19bc..fd2f2664e2 100644 --- a/internal/acceptance/openstack/imageservice/v2/tasks_test.go +++ b/internal/acceptance/openstack/image/v2/tasks_test.go @@ -1,5 +1,5 @@ -//go:build acceptance || imageservice || tasks -// +build acceptance imageservice tasks +//go:build acceptance || image || tasks +// +build acceptance image tasks package v2 @@ -9,13 +9,13 @@ import ( "github.com/gophercloud/gophercloud/v2/internal/acceptance/clients" "github.com/gophercloud/gophercloud/v2/internal/acceptance/tools" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks" "github.com/gophercloud/gophercloud/v2/pagination" th "github.com/gophercloud/gophercloud/v2/testhelper" ) func TestTasksListEachPage(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) listOpts := tasks.ListOpts{ @@ -36,7 +36,7 @@ func TestTasksListEachPage(t *testing.T) { } func TestTasksListAllPages(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) listOpts := tasks.ListOpts{} @@ -53,12 +53,12 @@ func TestTasksListAllPages(t *testing.T) { } func TestTaskCreate(t *testing.T) { - client, err := clients.NewImageServiceV2Client() + client, err := clients.NewImageV2Client() th.AssertNoErr(t, err) task, err := CreateTask(t, client, ImportImageURL) if err != nil { - t.Fatalf("Unable to create an Imageservice task: %v", err) + t.Fatalf("Unable to create an Image service task: %v", err) } tools.PrintResource(t, task) diff --git a/openstack/client.go b/openstack/client.go index ca3007be07..4fe07da4c4 100644 --- a/openstack/client.go +++ b/openstack/client.go @@ -434,9 +434,9 @@ func NewDNSV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) ( return sc, err } -// NewImageServiceV2 creates a ServiceClient that may be used to access the v2 -// image service. -func NewImageServiceV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { +// NewImageV2 creates a ServiceClient that may be used to access the v2 image +// service. +func NewImageV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { sc, err := initClientOpts(client, eo, "image") sc.ResourceBase = sc.Endpoint + "v2/" return sc, err diff --git a/openstack/imageservice/v2/README.md b/openstack/image/v2/README.md similarity index 100% rename from openstack/imageservice/v2/README.md rename to openstack/image/v2/README.md diff --git a/openstack/imageservice/v2/imagedata/doc.go b/openstack/image/v2/imagedata/doc.go similarity index 100% rename from openstack/imageservice/v2/imagedata/doc.go rename to openstack/image/v2/imagedata/doc.go diff --git a/openstack/imageservice/v2/imagedata/requests.go b/openstack/image/v2/imagedata/requests.go similarity index 98% rename from openstack/imageservice/v2/imagedata/requests.go rename to openstack/image/v2/imagedata/requests.go index 1e56bc2264..fd0f3e7ffd 100644 --- a/openstack/imageservice/v2/imagedata/requests.go +++ b/openstack/image/v2/imagedata/requests.go @@ -17,7 +17,7 @@ func Upload(ctx context.Context, client *gophercloud.ServiceClient, id string, d return } -// Stage performs PUT call on the existing image object in the Imageservice with +// Stage performs PUT call on the existing image object in the Image service with // the provided file. // Existing image object must be in the "queued" status. func Stage(ctx context.Context, client *gophercloud.ServiceClient, id string, data io.Reader) (r StageResult) { diff --git a/openstack/imageservice/v2/imagedata/results.go b/openstack/image/v2/imagedata/results.go similarity index 100% rename from openstack/imageservice/v2/imagedata/results.go rename to openstack/image/v2/imagedata/results.go diff --git a/openstack/imageservice/v2/imagedata/testing/doc.go b/openstack/image/v2/imagedata/testing/doc.go similarity index 100% rename from openstack/imageservice/v2/imagedata/testing/doc.go rename to openstack/image/v2/imagedata/testing/doc.go diff --git a/openstack/imageservice/v2/imagedata/testing/fixtures_test.go b/openstack/image/v2/imagedata/testing/fixtures_test.go similarity index 100% rename from openstack/imageservice/v2/imagedata/testing/fixtures_test.go rename to openstack/image/v2/imagedata/testing/fixtures_test.go diff --git a/openstack/imageservice/v2/imagedata/testing/requests_test.go b/openstack/image/v2/imagedata/testing/requests_test.go similarity index 96% rename from openstack/imageservice/v2/imagedata/testing/requests_test.go rename to openstack/image/v2/imagedata/testing/requests_test.go index a36d0a929c..8e1461e1c7 100644 --- a/openstack/imageservice/v2/imagedata/testing/requests_test.go +++ b/openstack/image/v2/imagedata/testing/requests_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imagedata" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/imagedata" th "github.com/gophercloud/gophercloud/v2/testhelper" fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client" ) diff --git a/openstack/imageservice/v2/imagedata/urls.go b/openstack/image/v2/imagedata/urls.go similarity index 100% rename from openstack/imageservice/v2/imagedata/urls.go rename to openstack/image/v2/imagedata/urls.go diff --git a/openstack/imageservice/v2/imageimport/doc.go b/openstack/image/v2/imageimport/doc.go similarity index 94% rename from openstack/imageservice/v2/imageimport/doc.go rename to openstack/image/v2/imageimport/doc.go index 775a3630b7..dc163ab3b3 100644 --- a/openstack/imageservice/v2/imageimport/doc.go +++ b/openstack/image/v2/imageimport/doc.go @@ -1,6 +1,6 @@ /* Package imageimport enables management of images import and retrieval of the -Imageservice Import API information. +Image service Import API information. Example to Get an information about the Import API diff --git a/openstack/imageservice/v2/imageimport/requests.go b/openstack/image/v2/imageimport/requests.go similarity index 100% rename from openstack/imageservice/v2/imageimport/requests.go rename to openstack/image/v2/imageimport/requests.go diff --git a/openstack/imageservice/v2/imageimport/results.go b/openstack/image/v2/imageimport/results.go similarity index 100% rename from openstack/imageservice/v2/imageimport/results.go rename to openstack/image/v2/imageimport/results.go diff --git a/openstack/imageservice/v2/imageimport/testing/doc.go b/openstack/image/v2/imageimport/testing/doc.go similarity index 100% rename from openstack/imageservice/v2/imageimport/testing/doc.go rename to openstack/image/v2/imageimport/testing/doc.go diff --git a/openstack/imageservice/v2/imageimport/testing/fixtures_test.go b/openstack/image/v2/imageimport/testing/fixtures_test.go similarity index 100% rename from openstack/imageservice/v2/imageimport/testing/fixtures_test.go rename to openstack/image/v2/imageimport/testing/fixtures_test.go diff --git a/openstack/imageservice/v2/imageimport/testing/requests_test.go b/openstack/image/v2/imageimport/testing/requests_test.go similarity index 95% rename from openstack/imageservice/v2/imageimport/testing/requests_test.go rename to openstack/image/v2/imageimport/testing/requests_test.go index 3de8cc8054..ae353ad0ac 100644 --- a/openstack/imageservice/v2/imageimport/testing/requests_test.go +++ b/openstack/image/v2/imageimport/testing/requests_test.go @@ -6,7 +6,7 @@ import ( "net/http" "testing" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/imageimport" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/imageimport" th "github.com/gophercloud/gophercloud/v2/testhelper" fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client" ) diff --git a/openstack/imageservice/v2/imageimport/urls.go b/openstack/image/v2/imageimport/urls.go similarity index 100% rename from openstack/imageservice/v2/imageimport/urls.go rename to openstack/image/v2/imageimport/urls.go diff --git a/openstack/imageservice/v2/images/doc.go b/openstack/image/v2/images/doc.go similarity index 100% rename from openstack/imageservice/v2/images/doc.go rename to openstack/image/v2/images/doc.go diff --git a/openstack/imageservice/v2/images/requests.go b/openstack/image/v2/images/requests.go similarity index 100% rename from openstack/imageservice/v2/images/requests.go rename to openstack/image/v2/images/requests.go diff --git a/openstack/imageservice/v2/images/results.go b/openstack/image/v2/images/results.go similarity index 99% rename from openstack/imageservice/v2/images/results.go rename to openstack/image/v2/images/results.go index 96644a9aeb..e46d6f9842 100644 --- a/openstack/imageservice/v2/images/results.go +++ b/openstack/image/v2/images/results.go @@ -20,7 +20,7 @@ type Image struct { Name string `json:"name"` // Status is the image status. It can be "queued" or "active" - // See imageservice/v2/images/type.go + // See image/v2/images/type.go Status ImageStatus `json:"status"` // Tags is a list of image tags. Tags are arbitrarily defined strings diff --git a/openstack/imageservice/v2/images/testing/doc.go b/openstack/image/v2/images/testing/doc.go similarity index 100% rename from openstack/imageservice/v2/images/testing/doc.go rename to openstack/image/v2/images/testing/doc.go diff --git a/openstack/imageservice/v2/images/testing/fixtures_test.go b/openstack/image/v2/images/testing/fixtures_test.go similarity index 100% rename from openstack/imageservice/v2/images/testing/fixtures_test.go rename to openstack/image/v2/images/testing/fixtures_test.go diff --git a/openstack/imageservice/v2/images/testing/requests_test.go b/openstack/image/v2/images/testing/requests_test.go similarity index 99% rename from openstack/imageservice/v2/images/testing/requests_test.go rename to openstack/image/v2/images/testing/requests_test.go index a4aaf0a9ef..2872e79b69 100644 --- a/openstack/imageservice/v2/images/testing/requests_test.go +++ b/openstack/image/v2/images/testing/requests_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/images" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/images" "github.com/gophercloud/gophercloud/v2/pagination" th "github.com/gophercloud/gophercloud/v2/testhelper" fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client" diff --git a/openstack/imageservice/v2/images/types.go b/openstack/image/v2/images/types.go similarity index 100% rename from openstack/imageservice/v2/images/types.go rename to openstack/image/v2/images/types.go diff --git a/openstack/imageservice/v2/images/urls.go b/openstack/image/v2/images/urls.go similarity index 100% rename from openstack/imageservice/v2/images/urls.go rename to openstack/image/v2/images/urls.go diff --git a/openstack/imageservice/v2/members/doc.go b/openstack/image/v2/members/doc.go similarity index 100% rename from openstack/imageservice/v2/members/doc.go rename to openstack/image/v2/members/doc.go diff --git a/openstack/imageservice/v2/members/requests.go b/openstack/image/v2/members/requests.go similarity index 100% rename from openstack/imageservice/v2/members/requests.go rename to openstack/image/v2/members/requests.go diff --git a/openstack/imageservice/v2/members/results.go b/openstack/image/v2/members/results.go similarity index 100% rename from openstack/imageservice/v2/members/results.go rename to openstack/image/v2/members/results.go diff --git a/openstack/imageservice/v2/members/testing/doc.go b/openstack/image/v2/members/testing/doc.go similarity index 100% rename from openstack/imageservice/v2/members/testing/doc.go rename to openstack/image/v2/members/testing/doc.go diff --git a/openstack/imageservice/v2/members/testing/fixtures_test.go b/openstack/image/v2/members/testing/fixtures_test.go similarity index 100% rename from openstack/imageservice/v2/members/testing/fixtures_test.go rename to openstack/image/v2/members/testing/fixtures_test.go diff --git a/openstack/imageservice/v2/members/testing/requests_test.go b/openstack/image/v2/members/testing/requests_test.go similarity index 98% rename from openstack/imageservice/v2/members/testing/requests_test.go rename to openstack/image/v2/members/testing/requests_test.go index 04717bfeea..981a22ffff 100644 --- a/openstack/imageservice/v2/members/testing/requests_test.go +++ b/openstack/image/v2/members/testing/requests_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/members" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/members" "github.com/gophercloud/gophercloud/v2/pagination" th "github.com/gophercloud/gophercloud/v2/testhelper" fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client" diff --git a/openstack/imageservice/v2/members/urls.go b/openstack/image/v2/members/urls.go similarity index 100% rename from openstack/imageservice/v2/members/urls.go rename to openstack/image/v2/members/urls.go diff --git a/openstack/imageservice/v2/tasks/doc.go b/openstack/image/v2/tasks/doc.go similarity index 98% rename from openstack/imageservice/v2/tasks/doc.go rename to openstack/image/v2/tasks/doc.go index 7904c6a832..689a1c7327 100644 --- a/openstack/imageservice/v2/tasks/doc.go +++ b/openstack/image/v2/tasks/doc.go @@ -1,6 +1,6 @@ /* Package tasks enables management and retrieval of tasks from the OpenStack -Imageservice. +Image service. Example to List Tasks diff --git a/openstack/imageservice/v2/tasks/requests.go b/openstack/image/v2/tasks/requests.go similarity index 93% rename from openstack/imageservice/v2/tasks/requests.go rename to openstack/image/v2/tasks/requests.go index fa6972b529..241e2ab7a7 100644 --- a/openstack/imageservice/v2/tasks/requests.go +++ b/openstack/image/v2/tasks/requests.go @@ -33,7 +33,7 @@ type ListOptsBuilder interface { } // ListOpts allows the filtering and sorting of paginated collections through -// the OpenStack Imageservice tasks API. +// the OpenStack Image service tasks API. type ListOpts struct { // Integer value for the limit of values to return. Limit int `q:"limit"` @@ -90,7 +90,7 @@ func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager { }) } -// Get retrieves a specific Imageservice task based on its ID. +// Get retrieves a specific Image service task based on its ID. func Get(ctx context.Context, c *gophercloud.ServiceClient, taskID string) (r GetResult) { resp, err := c.Get(ctx, getURL(c, taskID), &r.Body, nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) @@ -102,7 +102,7 @@ type CreateOptsBuilder interface { ToTaskCreateMap() (map[string]interface{}, error) } -// CreateOpts specifies parameters of a new Imageservice task. +// CreateOpts specifies parameters of a new Image service task. type CreateOpts struct { Type string `json:"type" required:"true"` Input map[string]interface{} `json:"input"` @@ -117,7 +117,7 @@ func (opts CreateOpts) ToTaskCreateMap() (map[string]interface{}, error) { return b, nil } -// Create requests the creation of a new Imageservice task on the server. +// Create requests the creation of a new Image service task on the server. func Create(ctx context.Context, client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { b, err := opts.ToTaskCreateMap() if err != nil { diff --git a/openstack/imageservice/v2/tasks/results.go b/openstack/image/v2/tasks/results.go similarity index 100% rename from openstack/imageservice/v2/tasks/results.go rename to openstack/image/v2/tasks/results.go diff --git a/openstack/imageservice/v2/tasks/testing/doc.go b/openstack/image/v2/tasks/testing/doc.go similarity index 100% rename from openstack/imageservice/v2/tasks/testing/doc.go rename to openstack/image/v2/tasks/testing/doc.go diff --git a/openstack/imageservice/v2/tasks/testing/fixtures_test.go b/openstack/image/v2/tasks/testing/fixtures_test.go similarity index 98% rename from openstack/imageservice/v2/tasks/testing/fixtures_test.go rename to openstack/image/v2/tasks/testing/fixtures_test.go index fc42383c92..de52a936c0 100644 --- a/openstack/imageservice/v2/tasks/testing/fixtures_test.go +++ b/openstack/image/v2/tasks/testing/fixtures_test.go @@ -3,7 +3,7 @@ package testing import ( "time" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks" ) // TasksListResult represents raw server response from a server to a list call. diff --git a/openstack/imageservice/v2/tasks/testing/requests_test.go b/openstack/image/v2/tasks/testing/requests_test.go similarity index 98% rename from openstack/imageservice/v2/tasks/testing/requests_test.go rename to openstack/image/v2/tasks/testing/requests_test.go index e6c8781d61..a8cc870fab 100644 --- a/openstack/imageservice/v2/tasks/testing/requests_test.go +++ b/openstack/image/v2/tasks/testing/requests_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/gophercloud/gophercloud/v2/openstack/imageservice/v2/tasks" + "github.com/gophercloud/gophercloud/v2/openstack/image/v2/tasks" "github.com/gophercloud/gophercloud/v2/pagination" th "github.com/gophercloud/gophercloud/v2/testhelper" fakeclient "github.com/gophercloud/gophercloud/v2/testhelper/client" diff --git a/openstack/imageservice/v2/tasks/urls.go b/openstack/image/v2/tasks/urls.go similarity index 100% rename from openstack/imageservice/v2/tasks/urls.go rename to openstack/image/v2/tasks/urls.go