Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithReadTimeout ¶ added in v0.6.3
func WithReadTimeout(minutes int) types.ClientOption[Client]
WithReadTimeout sets the read timeout in minutes for large transfers (e.g. OVA/image). Zero keeps SDK default.
Types ¶
type CacheOpts ¶ added in v0.5.0
type CacheOpts func(*ClientCache)
CacheOpts is a functional option for the ClientCache
func WithSessionAuth ¶ added in v0.5.0
WithSessionAuth sets the session auth for the ClientCache If sessionAuth is true, the client will use session auth instead of basic auth for authentication of requests If sessionAuth is false, the client will use basic auth for authentication of requests
type Client ¶
type Client struct {
CategoriesApiInstance *prismApi.CategoriesApi
ClustersApiInstance *clusterApi.ClustersApi
DomainManagerApiInstance *prismApi.DomainManagerApi
ImagesApiInstance *vmApi.ImagesApi
OvasApiInstance *vmApi.OvasApi
StorageContainerAPI *clusterApi.StorageContainersApi
SubnetsApiInstance *networkingApi.SubnetsApi
SubnetIPReservationApi *networkingApi.SubnetIPReservationApi
TasksApiInstance *prismApi.TasksApi
TemplatesApiInstance *vmApi.TemplatesApi
VolumeGroupsApiInstance *volumesApi.VolumeGroupsApi
VmApiInstance *vmApi.VmApi
VmAntiAffinityPoliciesApiInstance *vmApi.VmAntiAffinityPoliciesApi
UsersApiInstance *iamApi.UsersApi
// contains filtered or unexported fields
}
Client manages the V4 API
func NewV4Client ¶
func NewV4Client(credentials prismgoclient.Credentials, opts ...types.ClientOption[Client]) (*Client, error)
NewV4Client return an internal to operate V4 resources
type ClientCache ¶ added in v0.5.0
type ClientCache struct {
// contains filtered or unexported fields
}
ClientCache is a cache for prism clients
func NewClientCache ¶ added in v0.5.0
func NewClientCache(opts ...CacheOpts) *ClientCache
NewClientCache returns a new ClientCache
func (*ClientCache) Delete ¶ added in v0.5.0
func (c *ClientCache) Delete(params types.CachedClientParams)
Delete removes the client from the cache
func (*ClientCache) GetOrCreate ¶ added in v0.5.0
func (c *ClientCache) GetOrCreate(cachedClientParams types.CachedClientParams, opts ...types.ClientOption[Client]) (*Client, error)
GetOrCreate returns the client for the given client name and endpoint. - If the client is not found in the cache, it creates a new client, adds it to the cache, and returns it - If the client is found in the cache, it validates whether the client is still valid by comparing validation hashes - If the client is found in the cache and the validation hash is the same, it returns the client - If the client is found in the cache and the validation hash is different, it regenerates the client, updates the cache, and returns the client func (c *ClientCache) GetOrCreate(clientName string, endpoint types.ManagementEndpoint, opts ...ClientOption) (*Client, error) {