Documentation
¶
Index ¶
- Constants
- func GetCloud(ctx context.Context, client *client.HTTP, cloudID string) (*models.Cloud, error)
- func GetCloudDir(cloudID string) string
- func GetCloudSSHKeyDir(cloudID string) string
- func GetCloudSSHKeyPath(cloudID string, name string) string
- func GetGenInventoryCmd(mcDir string) string
- func GetMultiCloudRepodir() string
- func GetSecretFile(cloudID string) string
- func GetTFStateFile(cloudID string) string
- func GetTerraformAWSPlanFile(cloudID string) string
- func GetTerraformAzurePlanFile(cloudID string) string
- func GetTerraformGCPPlanFile(cloudID string) string
- func GetTopoFile(cloudID string) string
- func NewCloudHTTPClient(c *Config) *client.HTTP
- type AuthorizedRegistry
- type Cloud
- type Config
- type Data
- type Keypair
- type SecretFileConfig
- type TerraformState
Constants ¶
const ( DefaultCloudResourcePath = "/" + defaultCloudResource DefaultCloudLogPath = "/var/log/contrail/cloud.log" DefaultWorkRoot = "/var/tmp/cloud" DefaultTemplateRoot = "./pkg/cloud/configs" DefaultGenInventoryScript = "transform/generate_inventories.py" DefaultAWSPlanTF = "aws.tf.json" DefaultAzurePlanTF = "azure.tf.json" DefaultGCPPlanTF = "google.tf.json" DefaultTFStateFile = "terraform.tfstate" DefaultTopologyFile = "topology.yml" DefaultSecretFile = "secret.yml" DefaultMultiCloudDir = "/usr/share/contrail/" DefaultMultiCloudRepo = "contrail-multi-cloud" MultiCloudDockerImage = "contrail-multicloud-deployer" MultiCloudContainerPrefix = "multicloud-deployer" StatusField = "provisioning_state" StatusNoState = "NOSTATE" StatusCreated = "CREATED" StatusCreateProgress = "CREATE_IN_PROGRESS" StatusCreateFailed = "CREATE_FAILED" StatusUpdated = "UPDATED" StatusUpdateProgress = "UPDATE_IN_PROGRESS" StatusUpdateFailed = "UPDATE_FAILED" CreateAction = "create" UpdateAction = "update" DeleteCloudAction = "DELETE_CLOUD" )
Cloud related constants
Variables ¶
This section is empty.
Functions ¶
func GetCloudSSHKeyDir ¶
GetCloudSSHKeyDir returns directory of SSH key for given Cloud.
func GetCloudSSHKeyPath ¶
GetCloudSSHKeyPath returns path of SSH key for given Cloud and key name.
func GetGenInventoryCmd ¶
GetGenInventoryCmd get generate inventory command
func GetMultiCloudRepodir ¶
func GetMultiCloudRepodir() string
GetMultiCloudRepodir returns path to multi-cloud directory
func GetSecretFile ¶
GetSecretFile gets secret file for a cloud
func GetTFStateFile ¶
GetTFStateFile get terraform state file
func GetTerraformAWSPlanFile ¶
GetTerraformAWSPlanFile gets terraform AWS plan file
func GetTerraformAzurePlanFile ¶
GetTerraformAzurePlanFile gets terraform Azure plan file
func GetTerraformGCPPlanFile ¶
GetTerraformGCPPlanFile gets terraform GCP plan file
func GetTopoFile ¶
GetTopoFile gets topology file for a cloud
func NewCloudHTTPClient ¶
NewCloudHTTPClient returns a new HTTP client based on Cloud Config.
Types ¶
type AuthorizedRegistry ¶
type AuthorizedRegistry struct { Registry string `yaml:"registry,omitempty"` Username string `yaml:"username,omitempty"` Password string `yaml:"password,omitempty"` Tag string `yaml:"tag,omitempty"` }
AuthorizedRegistry stores the information about authorized docker registries
func NewAuthorizedRegistry ¶
func NewAuthorizedRegistry(c *models.ContrailCluster) (*AuthorizedRegistry, error)
NewAuthorizedRegistry creates AuthorizedRegistry based on ContrailCluster parameters
type Cloud ¶
Cloud represents cloud service.
func NewCloud ¶
func NewCloud( c *Config, terraformStateReader terraformStateReader, containerExecutor containerExecutor, httpClient *client.HTTP, reporter *report.Reporter, ) (*Cloud, error)
NewCloud returns a new Cloud instance
func NewCloudManager ¶
NewCloudManager creates cloud fields by a given *cloud.Config
func NewCloudManagerFromConfigFile ¶
NewCloudManagerFromConfigFile creates cloud fields by reading config from given configPath
func (*Cloud) HandleCloudRequest ¶
HandleCloudRequest handles Cloud create/update/delete request.
type Config ¶
type Config struct { // ID of cloud ID string `yaml:"id"` // Password of Cluster account. Password string `yaml:"password"` // DomainID is ID of keystone domain used for authentication. DomainID string `yaml:"domain_id"` // ProjectID is ID of keystone project used for authentication. ProjectID string `yaml:"project_id"` // DomainName is Name of keystone domain used for authentication. DomainName string `yaml:"domain_name"` // ProjectName is Name of keystone project used for authentication. ProjectName string `yaml:"project_name"` // AuthURL defines authentication URL. AuthURL string `yaml:"auth_url"` // Endpoint of API Server. Endpoint string `yaml:"endpoint"` // InSecure https connection to endpoint. InSecure bool `yaml:"insecure"` // UUID of cloud to be managed. CloudID string `yaml:"cloud_id,omitempty"` // Action to the performed with the cloud (values: create, update, delete). Action string `yaml:"cloud_action,omitempty"` // Logging level LogLevel string `yaml:"log_level"` // Logging file LogFile string `yaml:"log_file"` // Template root directory TemplateRoot string `yaml:"template_root"` // Optional Test var to run cloud in test mode Test bool `yaml:"test"` }
Config represents cloud configuration needed by cloudManager.
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data for cloud provider data
type SecretFileConfig ¶
type SecretFileConfig struct { Keypair Keypair `yaml:"public_key"` AWSAccessKey string `yaml:"aws_access_key,omitempty"` AWSSecretKey string `yaml:"aws_secret_key,omitempty"` AzureSubscriptionID string `yaml:"azure_subscription_id,omitempty"` AzureClientID string `yaml:"azure_client_id,omitempty"` AzureClientSecret string `yaml:"azure_client_secret,omitempty"` AzureTenantID string `yaml:"azure_tenant_id,omitempty"` GoogleAccount string `yaml:"google_credentials,omitempty"` AuthorizedRegistries []*AuthorizedRegistry `yaml:"authorized_registries,omitempty"` }
SecretFileConfig holds the secret keys of the cloud