Documentation ¶
Index ¶
- Constants
- func KeyForGLClientMap() string
- type Config
- func (c *Config) GetContext() context.Context
- func (c *Config) GetLocationID(locationName string) (locationID string, err error)
- func (c *Config) GetLocationName(locationID string) (string, error)
- func (c *Config) GetStoragePoolID(storagePoolName string) (string, error)
- func (c *Config) GetStoragePoolName(storagePoolID string) (string, error)
- func (c *Config) GetVolumeCollectionID(vcolName string) (string, error)
- func (c *Config) GetVolumeCollectionName(vcolID string) (string, error)
- func (c *Config) GetVolumeFlavorName(flavorID string) (string, error)
- func (c *Config) IsHosterContext() bool
- func (c *Config) RefreshAvailableResources() error
- type CreateOpt
- type Qjwt
Constants ¶
const QjwtExtension = ".qjwt"
Variables ¶
This section is empty.
Functions ¶
func KeyForGLClientMap ¶
func KeyForGLClientMap() string
KeyForGLClientMap is used by the GL terraform provider to set the key in the map of clients that it creates. The Metal client will be found using the key returned here.
Types ¶
type Config ¶
type Config struct { // Exported fields PortalURL string Client *rest.APIClient // we will cache this here for the life of the provider AvailableResources rest.AvailableResources // contains filtered or unexported fields }
Config holds all the information required to talk to the portal.
func (*Config) GetContext ¶
GetContext is used to retrieve the context. If the token retrieve function is nil the context in Config is returned If there is a token retrieve function it is executed to retrieve a GL IAM token, which is placed in the context before it is returned. If we get an error we log it and return the context with the new token.
func (*Config) GetLocationID ¶
func (*Config) GetLocationName ¶
func (*Config) GetStoragePoolID ¶ added in v1.3.43
func (*Config) GetStoragePoolName ¶ added in v1.3.43
func (*Config) GetVolumeCollectionID ¶ added in v1.3.45
GetVolumeCollectionID returns volume collection ID from volume collection name.
func (*Config) GetVolumeCollectionName ¶ added in v1.3.45
GetVolumeCollectionName return the ID of the volume collection.
func (*Config) GetVolumeFlavorName ¶
func (*Config) IsHosterContext ¶
IsHosterContext determines whether the provider configuration is project scope or hoster scope when GL IAM token is used. Project operations with Metal token not supported yet via Terraform, so 'false' is returned in this case. The scope determines what Metal APIs are allowed. Project resource create/delete/update requires Hoster scope configuration and, the remaining resources require Project scope configuration Project.
func (*Config) RefreshAvailableResources ¶
type CreateOpt ¶
type CreateOpt func(c *Config)
CreateOpt defines a create option.
func WithGLToken ¶
WithGLToken returns a create option with the provided GreenLake token.
func WithTRF ¶
func WithTRF(trf retrieve.TokenRetrieveFuncCtx) CreateOpt
WithTRF this create option is for use by the hpegl terraform provider It is used to pass-in a token retrieve function which is used to get a GL IAM token. Behind the scenes tokens are generated and refreshed if they are due to expire
func WithWorkspace ¶ added in v1.3.54
WithWorkspace returns a create option with the provided workspace.