Documentation ¶
Index ¶
- Constants
- Variables
- func GetAccountID(auth core.Authenticator) (string, error)
- func GetAuthenticator() (core.Authenticator, error)
- func GetEnvironment(env string) (map[string]string, error)
- func ListEnvironments() (keys []string)
- type Client
- func (c *Client) CreateServiceInstance(instanceName, serviceName, resourcePlanID, resourceGrp, region string) (*resourcecontrollerv2.ResourceInstance, error)
- func (c *Client) DeleteServiceInstance(instanceID string, recursive bool) error
- func (c *Client) ListServiceInstances(resourceId string) (map[string]string, error)
- func (c *Client) ListWorkspaceInstances() (*resourcecontrollerv2.ResourceInstancesList, error)
- type CreateResourceKeyOptions
- type CustomReader
- type PVMClient
- func NewGenericPVMClient(c *Client, instanceID string, session *ibmpisession.IBMPISession) (*PVMClient, error)
- func NewPVMClient(c *Client, instanceID, instanceName string, ep map[string]string) (*PVMClient, error)
- func NewPVMClientWithEnv(c *Client, instanceID, instanceName, env string) (*PVMClient, error)
- type ResourceControllerV2
- func (resourceController *ResourceControllerV2) CreateResourceKey(createResourceKeyOptions *CreateResourceKeyOptions) (result *rcv2.ResourceKey, response *core.DetailedResponse, err error)
- func (resourceController *ResourceControllerV2) CreateResourceKeyWithContext(ctx context.Context, createResourceKeyOptions *CreateResourceKeyOptions) (result *rcv2.ResourceKey, response *core.DetailedResponse, err error)
- func (resourceController *ResourceControllerV2) ListResourceKeysBySourceCrn(name, sourceCrn string) (keys []rcv2.ResourceKey, err error)
- type S3Client
- func (c *S3Client) CheckBucketExists(bucketName string) (bool, error)
- func (c *S3Client) CheckBucketLocationConstraint(bucketName string, bucketLocationConstraint string) (bool, error)
- func (c *S3Client) CheckIfObjectExists(bucketName, objectName string) (bool, error)
- func (c *S3Client) CopyObjectToBucket(srcBucketName string, destBucketName string, objectName string) error
- func (c *S3Client) CreateBucket(bucketName string) error
- func (c *S3Client) SelectObjects(bucketName string, regex string) ([]string, error)
- func (c *S3Client) UploadObject(fileName, objectName, bucketName string) error
- type User
Constants ¶
const ( DefaultEnvProd = "prod" TPEndpoint = "TPEndpoint" PIEndpoint = "PIEndpoint" RCEndpoint = "RCEndpoint" )
const (
AuthEndpoint = "https://iam.cloud.ibm.com/identity/token"
)
Variables ¶
var Environments = map[string]map[string]string{ "test": { TPEndpoint: "https://iam.test.cloud.ibm.com", RCEndpoint: "https://resource-controller.test.cloud.ibm.com", PIEndpoint: "power-iaas.test.cloud.ibm.com", }, "prod": { TPEndpoint: iamidentityv1.DefaultServiceURL, RCEndpoint: resourcecontrollerv2.DefaultServiceURL, PIEndpoint: "power-iaas.cloud.ibm.com", }, }
var ErrEnvironmentNotFound = errors.New("error environment not found")
Functions ¶
func GetAccountID ¶ added in v0.1.16
func GetAccountID(auth core.Authenticator) (string, error)
func GetAuthenticator ¶ added in v0.1.16
func GetAuthenticator() (core.Authenticator, error)
func ListEnvironments ¶
func ListEnvironments() (keys []string)
Types ¶
type Client ¶
type Client struct { User *User ResourceControllerClient *resourcecontrollerv2.ResourceControllerV2 ResourceManagerClient *resourcemanagerv2.ResourceManagerV2 ResourceControllerOpts *resourcecontrollerv2.ResourceControllerV2Options }
func (*Client) CreateServiceInstance ¶
func (c *Client) CreateServiceInstance(instanceName, serviceName, resourcePlanID, resourceGrp, region string) (*resourcecontrollerv2.ResourceInstance, error)
func (*Client) DeleteServiceInstance ¶
DeleteServiceInstance deletes service instances on the IBM Cloud, takes instanceID as input
func (*Client) ListServiceInstances ¶
ListServiceInstances list all available instances of particular servicetype
func (*Client) ListWorkspaceInstances ¶ added in v0.1.15
func (c *Client) ListWorkspaceInstances() (*resourcecontrollerv2.ResourceInstancesList, error)
ListWorkspaceInstances is used to retrieve serviceInstances along with their regions.
type CreateResourceKeyOptions ¶
type CreateResourceKeyOptions struct { *rcv2.CreateResourceKeyOptions // Overriding the Parameters to accommodate the HMAC parameter Parameters map[string]interface{} `json:"parameters,omitempty"` }
type CustomReader ¶ added in v0.1.8
type CustomReader struct {
// contains filtered or unexported fields
}
type PVMClient ¶
type PVMClient struct { InstanceName string InstanceID string Region string Zone string PISession *ibmpisession.IBMPISession CloudConnectionClient *cloudconnection.Client DatacenterClient *datacenter.Client DHCPClient *dhcp.Client EventsClient *events.Client ImgClient *image.Client InstanceClient *instance.Client JobClient *job.Client KeyClient *key.Client NetworkClient *network.Client StorageTierClient *storagetier.Client VolumeClient *volume.Client }
func NewGenericPVMClient ¶ added in v0.1.15
func NewGenericPVMClient(c *Client, instanceID string, session *ibmpisession.IBMPISession) (*PVMClient, error)
func NewPVMClient ¶
type ResourceControllerV2 ¶
type ResourceControllerV2 struct {
ResourceControllerV2 *rcv2.ResourceControllerV2
}
func (*ResourceControllerV2) CreateResourceKey ¶
func (resourceController *ResourceControllerV2) CreateResourceKey(createResourceKeyOptions *CreateResourceKeyOptions) (result *rcv2.ResourceKey, response *core.DetailedResponse, err error)
func (*ResourceControllerV2) CreateResourceKeyWithContext ¶
func (resourceController *ResourceControllerV2) CreateResourceKeyWithContext(ctx context.Context, createResourceKeyOptions *CreateResourceKeyOptions) (result *rcv2.ResourceKey, response *core.DetailedResponse, err error)
Overriding the CreateResourceKeyWithContext function from the ResourceControllerV2 code to work with HMAC parameter
func (*ResourceControllerV2) ListResourceKeysBySourceCrn ¶
func (resourceController *ResourceControllerV2) ListResourceKeysBySourceCrn(name, sourceCrn string) (keys []rcv2.ResourceKey, err error)
ListResourceKeysBySourceCrn will return all the resource keys by name belongs to a sourceCrn
type S3Client ¶
type S3Client struct { ApiKey string InstanceName string InstanceID string Region string StorageClass string SvcEndpoint string S3Session *s3.S3 }
func NewS3Client ¶
NewS3Client accepts apikey, instanceid of the IBM COS instance and return the s3 client to perform different s3 operations like upload, delete etc.,
func NewS3ClientWithKeys ¶ added in v0.1.16
Func NewS3ClientWithKeys accepts apikey, accesskey, secretkey of the bucket and returns the s3 client to perform operations like upload, delete, etc.
func (*S3Client) CheckBucketExists ¶
CheckBucketExists will verify for the existence of the bucket in the particular account
func (*S3Client) CheckBucketLocationConstraint ¶ added in v0.1.3
func (c *S3Client) CheckBucketLocationConstraint(bucketName string, bucketLocationConstraint string) (bool, error)
Func CheckBucketLocationConstraint will verify the existence of the bucket in the particular locationConstraint
func (*S3Client) CheckIfObjectExists ¶
func (*S3Client) CopyObjectToBucket ¶ added in v0.1.3
func (c *S3Client) CopyObjectToBucket(srcBucketName string, destBucketName string, objectName string) error
CopyObjectToBucket copies the object from src bucket to target bucket
func (*S3Client) CreateBucket ¶
CreateBucket creates a new bucket in the provided instance
func (*S3Client) SelectObjects ¶ added in v0.1.3
To select objects matching regex from src bucket
func (*S3Client) UploadObject ¶
To upload a object to S3 bucket