client

package
v0.1.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 35 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AuthEndpoint = "https://iam.cloud.ibm.com/identity/token"
)

Variables

This section is empty.

Functions

func CreateServiceInstance

func CreateServiceInstance(sess *session.Session, instanceName, serviceName, servicePlan, resourceGrp, region string) (string, error)

Func CreateServiceInstance will create a service instance IBM cloud service on IBM Cloud using resourcegroup api's. It will accept bluemix client, service type as input and return instance details.

Types

type Client

type Client struct {
	*bxsession.Session
	User           *User
	ResourceClient controllerv2.ResourceServiceInstanceRepository
}

func NewClient

func NewClient(apikey string) (*Client, error)

func (*Client) GetInstances

func (c *Client) GetInstances(serviceType string) (map[string]string, error)

Func GetInstances, list all available instances of particular servicetype

type CreateResourceKeyOptions

type CreateResourceKeyOptions struct {
	*rcv2.CreateResourceKeyOptions

	// Overriding the Parameters to accommodate the HMAC parameter
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

type PVMClient

type PVMClient struct {
	InstanceName string
	InstanceID   string
	Region       string
	Zone         string

	PISession      *ibmpisession.IBMPISession
	InstanceClient *instance.Client
	ImgClient      *image.Client
	VolumeClient   *volume.Client
	NetworkClient  *network.Client
	EventsClient   *events.Client
}

func NewPVMClient

func NewPVMClient(c *Client, instanceID, instanceName string) (*PVMClient, error)

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

func NewS3Client(c *Client, instanceName, region string) (s3client *S3Client, err error)

Func NewS3Client accepts apikey, instanceid of the IBM COS instance and return the s3 client to perform different s3 operations like upload, delete etc.,

func (*S3Client) CheckBucketExists

func (c *S3Client) CheckBucketExists(bucketName string) (bool, error)

Func CheckBucketExists will verify for the existence of the bucket in the particular account

func (*S3Client) CheckIfObjectExists

func (c *S3Client) CheckIfObjectExists(bucketName, objectName string) bool

func (*S3Client) CreateBucket

func (c *S3Client) CreateBucket(bucketName string) error

To create a new bucket in the provided instance

func (*S3Client) UploadObject

func (c *S3Client) UploadObject(fileName, objectName, bucketName string) error

To upload a object to S3 bucket

type User

type User struct {
	ID      string
	Email   string
	Account string
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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