api

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	*coreclient.APIClient
	// contains filtered or unexported fields
}

APIClient wraps the core API client with region-specific methods. Add methods here as you write tests for specific endpoints.

func NewAPIClient

func NewAPIClient(baseURL string) (*APIClient, error)

NewAPIClient creates a new Region API client.

func NewAPIClientWithConfig

func NewAPIClientWithConfig(config *TestConfig) *APIClient

NewAPIClientWithConfig creates a new Region API client with the given config.

func (*APIClient) GetListRegionsPath

func (c *APIClient) GetListRegionsPath(orgID string) string

GetListRegionsPath returns the path for listing regions. This is useful for tests that need direct access to the endpoint path.

func (*APIClient) GetRegionDetail

func (c *APIClient) GetRegionDetail(ctx context.Context, orgID, regionID string) (*regionopenapi.RegionDetailRead, error)

GetRegionDetail gets detailed information about a specific region.

func (*APIClient) ListExternalNetworks

func (c *APIClient) ListExternalNetworks(ctx context.Context, orgID, regionID string) (regionopenapi.ExternalNetworks, error)

ListExternalNetworks lists all external networks available in a region.

func (*APIClient) ListFlavors

func (c *APIClient) ListFlavors(ctx context.Context, orgID, regionID string) (regionopenapi.Flavors, error)

ListFlavors lists all flavors available in a region.

func (*APIClient) ListImages

func (c *APIClient) ListImages(ctx context.Context, orgID, regionID string) (regionopenapi.Images, error)

ListImages lists all images available in a region.

func (*APIClient) ListRegions

func (c *APIClient) ListRegions(ctx context.Context, orgID string) (regionopenapi.Regions, error)

ListRegions lists all regions for an organization.

type Endpoints

type Endpoints struct{}

Endpoints contains API endpoint patterns. Add endpoint methods here as you write tests for them.

func NewEndpoints

func NewEndpoints() *Endpoints

NewEndpoints creates a new Endpoints instance.

func (*Endpoints) GetRegionDetail

func (e *Endpoints) GetRegionDetail(orgID, regionID string) string

GetRegionDetail returns the endpoint for getting detailed region information.

func (*Endpoints) ListExternalNetworks

func (e *Endpoints) ListExternalNetworks(orgID, regionID string) string

ListExternalNetworks returns the endpoint for listing external networks in a region.

func (*Endpoints) ListFlavors

func (e *Endpoints) ListFlavors(orgID, regionID string) string

ListFlavors returns the endpoint for listing flavors in a region.

func (*Endpoints) ListImages

func (e *Endpoints) ListImages(orgID, regionID string) string

ListImages returns the endpoint for listing images in a region.

func (*Endpoints) ListRegions

func (e *Endpoints) ListRegions(orgID string) string

ListRegions returns the endpoint for listing all regions in an organization.

type GinkgoLogger

type GinkgoLogger struct{}

GinkgoLogger implements the Logger interface for Ginkgo tests.

func (*GinkgoLogger) Printf

func (g *GinkgoLogger) Printf(format string, args ...interface{})

type TestConfig

type TestConfig struct {
	coreconfig.BaseConfig
	OrgID         string
	ProjectID     string
	RegionID      string
	RegionBaseURL string
}

TestConfig extends the base config with Region-specific fields.

func LoadTestConfig

func LoadTestConfig() (*TestConfig, error)

LoadTestConfig loads configuration from environment variables and .env files using viper. Returns an error if required configuration values are missing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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