Documentation
¶
Overview ¶
Copyright © 2018 Zechen Jiang <zechen@cloudcoreo.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func NewError(text string) error
- type AWSEventRemoveConfig
- type AWSEventStreamConfig
- type Auth
- type AzureEventRemoveConfig
- type AzureEventStreamConfig
- type Client
- func (c *Client) CreateCloudAccount(ctx context.Context, input *CreateCloudAccountInput) (*CloudAccount, error)
- func (c *Client) DeleteCloudAccountByID(ctx context.Context, accountNumber, provider string) error
- func (c *Client) Do(ctx context.Context, method, path string, body io.Reader, obj interface{}) error
- func (c *Client) GetCloudAccountByID(ctx context.Context, accountNumber, provider string) (*CloudAccount, error)
- func (c *Client) GetCloudAccounts(ctx context.Context) ([]*CloudAccount, error)
- func (c *Client) GetRemoveConfig(ctx context.Context, accountNumber, provider string) (*EventRemoveConfig, error)
- func (c *Client) GetRoleCreationInfo(ctx context.Context, input *CreateCloudAccountInput) (*RoleCreationInfo, error)
- func (c *Client) GetSetupConfig(ctx context.Context, accountNumber, provider string) (*EventStreamConfig, error)
- func (c *Client) ReValidateRole(ctx context.Context, accountNumber, provider string) (*RoleReValidationResult, error)
- func (c *Client) UpdateCloudAccount(ctx context.Context, input *UpdateCloudAccountInput) (*CloudAccount, error)
- type CloudAccount
- type CloudInfo
- type CreateCloudAccountInput
- type EventRemoveConfig
- type EventStreamConfig
- type Interceptor
- type Option
- type RoleCreationInfo
- type RoleReValidationResult
- type UpdateCloudAccountInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AWSEventRemoveConfig ¶ added in v0.0.36
type AWSEventRemoveConfig struct { StackName string `json:"stackName"` TopicName string `json:"topicName"` Regions []string `json:"regions"` ArnType string `json:"arnType"` CloudAccountID string `json:"cloudAccountId"` }
AWSEventRemoveConfig contains info needed for AWS event stream removal
type AWSEventStreamConfig ¶ added in v0.0.31
type AWSEventStreamConfig struct { TemplateURL string `json:"templateURL"` TopicName string `json:"topicName"` StackName string `json:"stackName"` DevtimeQueueArn string `json:"devtimeQueueArn"` Version string `json:"version"` MonitorRule string `json:"monitorRule"` Regions []string `json:"regions"` TopicEncryptionKeyName string `json:"topicEncryptionKeyName"` }
AWSEventStreamConfig contains info needed for AWS event stream setup
type AzureEventRemoveConfig ¶ added in v0.0.36
type AzureEventRemoveConfig struct { SubscriptionID string `json:"subscriptionId"` ResourceGroup string `json:"resourceGroup"` WebhookServiceURI string `json:"webhookServiceUri"` }
AzureEventRemoveConfig contains info needed for Azure event stream removal
type AzureEventStreamConfig ¶ added in v0.0.31
type AzureEventStreamConfig struct { SubscriptionID string `json:"subscriptionId"` ActionDeployFile string `json:"actionDeployFile"` AlertDeployFile string `json:"alertDeployFile"` WebhookServiceURI string `json:"webhookServiceUri"` ResourceGroup string `json:"resourceGroup"` ActionDeploymentName string `json:"actionDeploymentName"` AlertDeploymentName string `json:"alertDeploymentName"` ActionGroup string `json:"actionGroup"` ActionGroupShort string `json:"actionGroupShort"` WebhookReceiverName string `json:"webhookReceiverName"` AlertName string `json:"alertName"` }
AzureEventStreamConfig contains info needed for Azure event stream setup
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct
func MakeClient ¶
MakeClient make client
func (*Client) CreateCloudAccount ¶
func (c *Client) CreateCloudAccount(ctx context.Context, input *CreateCloudAccountInput) (*CloudAccount, error)
CreateCloudAccount method to create a cloud object
func (*Client) DeleteCloudAccountByID ¶
DeleteCloudAccountByID method to delete cloud object
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, method, path string, body io.Reader, obj interface{}) error
Do performs an HTTP request with a given context - the response will be decoded into obj.
func (*Client) GetCloudAccountByID ¶
func (c *Client) GetCloudAccountByID(ctx context.Context, accountNumber, provider string) (*CloudAccount, error)
GetCloudAccountByID method getting cloud account by user ID
func (*Client) GetCloudAccounts ¶
func (c *Client) GetCloudAccounts(ctx context.Context) ([]*CloudAccount, error)
GetCloudAccounts method for cloud command
func (*Client) GetRemoveConfig ¶ added in v0.0.23
func (c *Client) GetRemoveConfig(ctx context.Context, accountNumber, provider string) (*EventRemoveConfig, error)
GetRemoveConfig get the config for event stream removal from secure state
func (*Client) GetRoleCreationInfo ¶ added in v0.0.21
func (c *Client) GetRoleCreationInfo(ctx context.Context, input *CreateCloudAccountInput) (*RoleCreationInfo, error)
GetRoleCreationInfo returns the configuration for creating a new role
func (*Client) GetSetupConfig ¶ added in v0.0.20
func (c *Client) GetSetupConfig(ctx context.Context, accountNumber, provider string) (*EventStreamConfig, error)
GetSetupConfig get the config for event stream setup from secure state
func (*Client) ReValidateRole ¶ added in v0.0.27
func (c *Client) ReValidateRole(ctx context.Context, accountNumber, provider string) (*RoleReValidationResult, error)
ReValidateRole checks role validation and re-validate it
func (*Client) UpdateCloudAccount ¶ added in v0.0.27
func (c *Client) UpdateCloudAccount(ctx context.Context, input *UpdateCloudAccountInput) (*CloudAccount, error)
UpdateCloudAccount updates cloud account
type CloudAccount ¶
type CloudAccount struct { RoleID string `json:"roleId,omitempty"` RoleName string `json:"roleName,omitempty"` AccountID string `json:"accountId,omitempty"` ID string `json:"_id,omitempty"` CloudInfo }
CloudAccount Information
type CloudInfo ¶ added in v0.0.27
type CloudInfo struct { Name string `json:"name,omitempty"` Arn string `json:"arn,omitempty"` ScanEnabled bool `json:"scanEnabled"` ScanInterval string `json:"scanInterval,omitempty"` ScanRegion string `json:"scanRegion,omitempty"` ExternalID string `json:"externalId,omitempty"` IsDraft bool `json:"isDraft"` Provider string `json:"provider"` Email string `json:"email,omitempty"` UserName string `json:"username,omitempty"` Environment string `json:"environment,omitempty"` KeyValue string `json:"key,omitempty"` ApplicationID string `json:"appId,omitempty"` DirectoryID string `json:"directoryId,omitempty"` SubscriptionID string `json:"subscriptionId,omitempty"` Tags []string `json:"tags,omitempty"` IsValid bool `json:"isValid"` LastValidationCheck string `json:"lastValidationCheck,omitempty"` CSPProjectID string `json:"cspProjectId,omitempty"` }
CloudInfo listed all info of cloud accounts
type CreateCloudAccountInput ¶ added in v0.0.20
type CreateCloudAccountInput struct { CloudName string RoleName string ExternalID string RoleArn string Policy string IsDraft bool Email string UserName string Environment string ScanEnabled bool Provider string KeyValue string ApplicationID string DirectoryID string SubscriptionID string Tags string CSPProjectID string }
CreateCloudAccountInput for function CreateCloudAccount
type EventRemoveConfig ¶ added in v0.0.23
type EventRemoveConfig struct { AWSEventRemoveConfig AzureEventRemoveConfig Provider string `json:"provider"` }
EventRemoveConfig for event stream removal
type EventStreamConfig ¶ added in v0.0.20
type EventStreamConfig struct { AWSEventStreamConfig AzureEventStreamConfig Provider string `json:"provider"` }
EventStreamConfig for event stream setup
type Interceptor ¶
Interceptor is a generic request interceptor, useful for modifying or canceling the request.
type Option ¶
type Option func(*clientOptions)
Option type
func WithInterceptor ¶
func WithInterceptor(ci Interceptor) Option
WithInterceptor returns a ClientOption for adding an interceptor to a Client.
type RoleCreationInfo ¶ added in v0.0.21
RoleCreationInfo contains the info required for role creation
type RoleReValidationResult ¶ added in v0.0.27
type RoleReValidationResult struct { Message string `json:"message"` IsValid bool `json:"isValid"` }
RoleReValidationResult is the result for role re-validation
type UpdateCloudAccountInput ¶ added in v0.0.27
type UpdateCloudAccountInput struct { CreateCloudAccountInput AccountNumber string }
UpdateCloudAccountInput is the info needed for update cloud account