aviclient

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright 2021 VMware, Inc. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyInput = errors.New("input is empty")

Functions

func GetUUIDFromRef

func GetUUIDFromRef(ref string) string

GetUUIDFromRef takes a AVI Ref, parses it as a classic URL and returns the last part

func IsAviRoleNonExistentError

func IsAviRoleNonExistentError(err error) bool

IsAviRoleNonExistentError returns if an error is User role doesn't exist error by matching error message

func IsAviUserAlreadyExistsError

func IsAviUserAlreadyExistsError(err error) bool

IsAviUserAlreadyExistsError returns if an error is User Already Exists error by matching error message

func IsAviUserNonExistentError

func IsAviUserNonExistentError(err error) bool

IsAviUserAlreadyExistsError returns if an error is User doesn't exist error by matching error message

func NewAviClient

func NewAviClient(config *AviClientConfig, version string) (*realAviClient, error)

NewAviClient creates an Client

func NewAviClientFromSecrets

func NewAviClientFromSecrets(c client.Client, ctx context.Context, log logr.Logger,
	controllerIP, credName, credNamespace, caName, caNamespace, version string) (*realAviClient, error)

NewAviClientFromSecrets creates a Client from two secrets, adminCredential and CA

Types

type AviClientConfig

type AviClientConfig struct {
	ServerIP  string
	Username  string
	Password  string
	CA        string
	Insecure  bool // Should only be used for tests
	Transport *http.Transport

	// ServerName is used to verify the hostname on the returned
	// certificates unless Insecure is true. It is also included
	// in the client's handshake to support virtual hosting unless it is
	// an IP address.
	ServerName string
}

type Client

type Client interface {
	ServiceEngineGroupGetByName(name, cloudName string, options ...session.ApiOptionsParams) (*models.ServiceEngineGroup, error)
	ServiceEngineGroupCreate(obj *models.ServiceEngineGroup, options ...session.ApiOptionsParams) (*models.ServiceEngineGroup, error)

	NetworkGetByName(name, cloudName string, options ...session.ApiOptionsParams) (*models.Network, error)
	NetworkCreate(obj *models.Network, options ...session.ApiOptionsParams) (*models.Network, error)
	NetworkUpdate(obj *models.Network, options ...session.ApiOptionsParams) (*models.Network, error)

	CloudGetByName(name string, options ...session.ApiOptionsParams) (*models.Cloud, error)
	CloudCreate(obj *models.Cloud, options ...session.ApiOptionsParams) (*models.Cloud, error)

	UserGetByName(name string, options ...session.ApiOptionsParams) (*models.User, error)
	UserDeleteByName(name string, options ...session.ApiOptionsParams) error
	UserCreate(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)
	UserUpdate(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)

	TenantGet(uuid string, options ...session.ApiOptionsParams) (*models.Tenant, error)

	RoleGetByName(name string, options ...session.ApiOptionsParams) (*models.Role, error)
	RoleCreate(obj *models.Role, options ...session.ApiOptionsParams) (*models.Role, error)

	IPAMDNSProviderProfileGet(uuid string, options ...session.ApiOptionsParams) (*models.IPAMDNSProviderProfile, error)
	IPAMDNSProviderProfileUpdate(obj *models.IPAMDNSProviderProfile, options ...session.ApiOptionsParams) (*models.IPAMDNSProviderProfile, error)

	VirtualServiceGetByName(name string, options ...session.ApiOptionsParams) (*models.VirtualService, error)

	PoolGetByName(name string, options ...session.ApiOptionsParams) (*models.Pool, error)

	AviCertificateConfig() (string, error)

	GetControllerVersion() (string, error)
}

type CloudClient

type CloudClient struct {
	// contains filtered or unexported fields
}

Cloud Client

func (*CloudClient) GetByName

func (client *CloudClient) GetByName(name string, options ...session.ApiOptionsParams) (*models.Cloud, error)

func (*CloudClient) SetGetByNameCloudFunc

func (client *CloudClient) SetGetByNameCloudFunc(fn GetByNameCloudFunc)

type CreateRoleFunc

type CreateRoleFunc func(obj *models.Role, options ...session.ApiOptionsParams) (*models.Role, error)

type CreateUserFunc

type CreateUserFunc func(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)

type DeleteByNameUserFunc

type DeleteByNameUserFunc func(name string, options ...session.ApiOptionsParams) error

type FakeAviClient

type FakeAviClient struct {
	ServiceEngineGroup     *ServiceEngineGroupClient
	Network                *NetworkClient
	Cloud                  *CloudClient
	IPAMDNSProviderProfile *IPAMDNSProviderProfileClient
	User                   *UserClient
	Tenant                 *TenantClient
	Role                   *RoleClient
	VirtualService         *VirtualServiceClient
	Pool                   *PoolClient
}

FakeAviClient -- an API Client for Avi Controller for intg test of AkoDeploymentConfig

func NewFakeAviClient

func NewFakeAviClient() *FakeAviClient

func (*FakeAviClient) AviCertificateConfig

func (r *FakeAviClient) AviCertificateConfig() (string, error)

func (*FakeAviClient) CloudCreate

func (r *FakeAviClient) CloudCreate(obj *models.Cloud, options ...session.ApiOptionsParams) (*models.Cloud, error)

func (*FakeAviClient) CloudGetByName

func (r *FakeAviClient) CloudGetByName(name string, options ...session.ApiOptionsParams) (*models.Cloud, error)

func (*FakeAviClient) GetControllerVersion

func (r *FakeAviClient) GetControllerVersion() (string, error)

func (*FakeAviClient) IPAMDNSProviderProfileGet

func (r *FakeAviClient) IPAMDNSProviderProfileGet(uuid string, options ...session.ApiOptionsParams) (*models.IPAMDNSProviderProfile, error)

func (*FakeAviClient) IPAMDNSProviderProfileUpdate

func (r *FakeAviClient) IPAMDNSProviderProfileUpdate(obj *models.IPAMDNSProviderProfile, options ...session.ApiOptionsParams) (*models.IPAMDNSProviderProfile, error)

func (*FakeAviClient) NetworkCreate

func (r *FakeAviClient) NetworkCreate(obj *models.Network, options ...session.ApiOptionsParams) (*models.Network, error)

func (*FakeAviClient) NetworkGetByName

func (r *FakeAviClient) NetworkGetByName(name, cloudName string, options ...session.ApiOptionsParams) (*models.Network, error)

func (*FakeAviClient) NetworkUpdate

func (r *FakeAviClient) NetworkUpdate(obj *models.Network, options ...session.ApiOptionsParams) (*models.Network, error)

func (*FakeAviClient) PoolGetByName

func (r *FakeAviClient) PoolGetByName(name string, options ...session.ApiOptionsParams) (*models.Pool, error)

func (*FakeAviClient) RoleCreate

func (r *FakeAviClient) RoleCreate(obj *models.Role, options ...session.ApiOptionsParams) (*models.Role, error)

func (*FakeAviClient) RoleGetByName

func (r *FakeAviClient) RoleGetByName(name string, options ...session.ApiOptionsParams) (*models.Role, error)

func (*FakeAviClient) ServiceEngineGroupCreate

func (r *FakeAviClient) ServiceEngineGroupCreate(obj *models.ServiceEngineGroup, options ...session.ApiOptionsParams) (*models.ServiceEngineGroup, error)

func (*FakeAviClient) ServiceEngineGroupGetByName

func (r *FakeAviClient) ServiceEngineGroupGetByName(name, cloudName string, options ...session.ApiOptionsParams) (*models.ServiceEngineGroup, error)

func (*FakeAviClient) TenantGet

func (r *FakeAviClient) TenantGet(uuid string, options ...session.ApiOptionsParams) (*models.Tenant, error)

func (*FakeAviClient) UserCreate

func (r *FakeAviClient) UserCreate(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)

func (*FakeAviClient) UserDeleteByName

func (r *FakeAviClient) UserDeleteByName(name string, options ...session.ApiOptionsParams) error

func (*FakeAviClient) UserGetByName

func (r *FakeAviClient) UserGetByName(name string, options ...session.ApiOptionsParams) (*models.User, error)

func (*FakeAviClient) UserUpdate

func (r *FakeAviClient) UserUpdate(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)

func (*FakeAviClient) VirtualServiceGetByName

func (r *FakeAviClient) VirtualServiceGetByName(name string, options ...session.ApiOptionsParams) (*models.VirtualService, error)

type GetByNameCloudFunc

type GetByNameCloudFunc func(name string, options ...session.ApiOptionsParams) (*models.Cloud, error)

type GetByNameFunc

type GetByNameFunc func(name string, options ...session.ApiOptionsParams) (*models.Network, error)

type GetByNamePoolFunc

type GetByNamePoolFunc func(name string, options ...session.ApiOptionsParams) (*models.Pool, error)

type GetByNameRoleFunc

type GetByNameRoleFunc func(name string, options ...session.ApiOptionsParams) (*models.Role, error)

type GetByNameSEGFunc

type GetByNameSEGFunc func(name string, options ...session.ApiOptionsParams) (*models.ServiceEngineGroup, error)

type GetByNameUserFunc

type GetByNameUserFunc func(name string, options ...session.ApiOptionsParams) (*models.User, error)

type GetByNameVSFunc

type GetByNameVSFunc func(name string, options ...session.ApiOptionsParams) (*models.VirtualService, error)

type GetIPAMFunc

type GetIPAMFunc func(uuid string, options ...session.ApiOptionsParams) (*models.IPAMDNSProviderProfile, error)

type GetTenantFunc

type GetTenantFunc func(uuid string, options ...session.ApiOptionsParams) (*models.Tenant, error)

type IPAMDNSProviderProfileClient

type IPAMDNSProviderProfileClient struct {
	// contains filtered or unexported fields
}

IPAMDNSProviderProfile

func (*IPAMDNSProviderProfileClient) Get

func (*IPAMDNSProviderProfileClient) SetGetIPAMFunc

func (client *IPAMDNSProviderProfileClient) SetGetIPAMFunc(fn GetIPAMFunc)

func (*IPAMDNSProviderProfileClient) SetUpdateIPAMFn

func (client *IPAMDNSProviderProfileClient) SetUpdateIPAMFn(fn UpdateIPAMFn)

func (*IPAMDNSProviderProfileClient) Update

type NetworkClient

type NetworkClient struct {
	// contains filtered or unexported fields
}

Network Client

func (*NetworkClient) GetByName

func (client *NetworkClient) GetByName(name string, options ...session.ApiOptionsParams) (*models.Network, error)

func (*NetworkClient) SetGetByNameFn

func (client *NetworkClient) SetGetByNameFn(fn GetByNameFunc)

func (*NetworkClient) SetUpdateFn

func (client *NetworkClient) SetUpdateFn(fn UpdateFn)

func (*NetworkClient) Update

func (client *NetworkClient) Update(obj *models.Network, options ...session.ApiOptionsParams) (*models.Network, error)

type PoolClient

type PoolClient struct {
	// contains filtered or unexported fields
}

Pool Client

func (*PoolClient) GetByName

func (client *PoolClient) GetByName(name string, options ...session.ApiOptionsParams) (*models.Pool, error)

func (*PoolClient) SetGetByNameFn

func (client *PoolClient) SetGetByNameFn(fn GetByNamePoolFunc)

type RoleClient

type RoleClient struct {
	// contains filtered or unexported fields
}

Role Client

func (*RoleClient) Create

func (client *RoleClient) Create(obj *models.Role, options ...session.ApiOptionsParams) (*models.Role, error)

func (*RoleClient) GetByName

func (client *RoleClient) GetByName(name string, options ...session.ApiOptionsParams) (*models.Role, error)

func (*RoleClient) SetCreateRoleFunc

func (client *RoleClient) SetCreateRoleFunc(fn CreateRoleFunc)

func (*RoleClient) SetGetByNameRoleFunc

func (client *RoleClient) SetGetByNameRoleFunc(fn GetByNameRoleFunc)

type ServiceEngineGroupClient

type ServiceEngineGroupClient struct {
	// contains filtered or unexported fields
}

ServiceEngineGroup Client

func (*ServiceEngineGroupClient) GetByName

func (client *ServiceEngineGroupClient) GetByName(name string, options ...session.ApiOptionsParams) (*models.ServiceEngineGroup, error)

func (*ServiceEngineGroupClient) SetGetByNameFn

func (client *ServiceEngineGroupClient) SetGetByNameFn(fn GetByNameSEGFunc)

type TenantClient

type TenantClient struct {
	// contains filtered or unexported fields
}

Tenant Client

func (*TenantClient) Get

func (client *TenantClient) Get(uuid string, options ...session.ApiOptionsParams) (*models.Tenant, error)

func (*TenantClient) SetGetTenantFunc

func (client *TenantClient) SetGetTenantFunc(fn GetTenantFunc)

type UpdateFn

type UpdateFn func(obj *models.Network, options ...session.ApiOptionsParams) (*models.Network, error)

type UpdateUserFunc

type UpdateUserFunc func(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

User Client

func (*UserClient) Create

func (client *UserClient) Create(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)

func (*UserClient) DeleteByName

func (client *UserClient) DeleteByName(name string, options ...session.ApiOptionsParams) error

func (*UserClient) GetByName

func (client *UserClient) GetByName(name string, options ...session.ApiOptionsParams) (*models.User, error)

func (*UserClient) SetCreateUserFunc

func (client *UserClient) SetCreateUserFunc(fn CreateUserFunc)

func (*UserClient) SetDeleteByNameUserFunc

func (client *UserClient) SetDeleteByNameUserFunc(fn DeleteByNameUserFunc)

func (*UserClient) SetGetByNameUserFunc

func (client *UserClient) SetGetByNameUserFunc(fn GetByNameUserFunc)

func (*UserClient) SetUpdateUserFunc

func (client *UserClient) SetUpdateUserFunc(fn UpdateUserFunc)

func (*UserClient) Update

func (client *UserClient) Update(obj *models.User, options ...session.ApiOptionsParams) (*models.User, error)

type VirtualServiceClient

type VirtualServiceClient struct {
	// contains filtered or unexported fields
}

VirtualService Client

func (*VirtualServiceClient) GetByName

func (client *VirtualServiceClient) GetByName(name string, options ...session.ApiOptionsParams) (*models.VirtualService, error)

func (*VirtualServiceClient) SetGetByNameFn

func (client *VirtualServiceClient) SetGetByNameFn(fn GetByNameVSFunc)

Jump to

Keyboard shortcuts

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