ibmcloud

package
v0.0.0-...-72fcd15 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Metadata Metadata `json:"metadata"`
	Entity   Entity   `json:"entity"`
}

type AccountSession

type AccountSession struct {
	Token *Token
}

func (*AccountSession) CreateCredential

func (s *AccountSession) CreateCredential(params CreateCredentialParams) (*Credential, error)

func (*AccountSession) GetCredentials

func (s *AccountSession) GetCredentials(params GetCredentialsParams) (*Credentials, error)

func (*AccountSession) GetMachineLearningResources

func (s *AccountSession) GetMachineLearningResources() (*Resources, error)

func (*AccountSession) GetMachineLearningResourcesWithEndpoint

func (s *AccountSession) GetMachineLearningResourcesWithEndpoint(nextURL *string) (*Resources, error)

func (*AccountSession) GetObjectStorageResources

func (s *AccountSession) GetObjectStorageResources() (*Resources, error)

func (*AccountSession) GetObjectStorageResourcesWithEndpoint

func (s *AccountSession) GetObjectStorageResourcesWithEndpoint(nextURL *string) (*Resources, error)

type Accounts

type Accounts struct {
	NextURL      *string   `json:"next_url"`
	TotalResults int       `json:"total_results"`
	Resources    []Account `json:"resources"`
}

type BluemixSubscriptions

type BluemixSubscriptions struct {
	Type                  string        `json:"type"`
	State                 string        `json:"state"`
	PaymentMethod         PaymentMethod `json:"payment_method"`
	SubscriptionID        string        `json:"subscription_id"`
	PartNumber            string        `json:"part_number"`
	SubscriptionTags      []interface{} `json:"subscriptionTags"`
	PaygPendingTimestamp  string        `json:"payg_pending_timestamp"`
	History               []interface{} `json:"history"`
	CurrentStateTimestamp string        `json:"current_state_timestamp"`
	SoftlayerAccountID    string        `json:"softlayer_account_id"`
	BillingSystem         string        `json:"billing_system"`
	AdditionalCharges     []interface{} `json:"additional_charges"`
}

type ComputeConfiguration

type ComputeConfiguration struct {
	Name string `json:"name"`
}

type Connection

type Connection struct {
	EndpointURL     string `json:"endpoint_url"`
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
}

type ContentStatus

type ContentStatus struct {
	State string `json:"state"`
}

type CosHmacKeys

type CosHmacKeys struct {
	AccessKeyID     string `json:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key"`
}

type CreateCredentialParams

type CreateCredentialParams struct {
	Name       string         `json:"name"`
	Source     string         `json:"source"`
	Role       string         `json:"role"`
	Parameters HMACParameters `json:"parameters"`
}

type Credential

type Credential struct {
	ID                  string        `json:"id"`
	GUID                string        `json:"guid"`
	URL                 string        `json:"url"`
	CreatedAt           string        `json:"created_at"`
	UpdatedAt           string        `json:"updated_at"`
	DeletedAt           interface{}   `json:"deleted_at"`
	CreatedBy           string        `json:"created_by"`
	UpdatedBy           string        `json:"updated_by"`
	DeletedBy           string        `json:"deleted_by"`
	SourceCrn           string        `json:"source_crn"`
	Name                string        `json:"name"`
	Role                string        `json:"role"`
	Crn                 string        `json:"crn"`
	State               string        `json:"state"`
	AccountID           string        `json:"account_id"`
	ResourceGroupID     string        `json:"resource_group_id"`
	ResourceID          string        `json:"resource_id"`
	Credentials         CredentialSet `json:"credentials"`
	IamCompatible       bool          `json:"iam_compatible"`
	Migrated            bool          `json:"migrated"`
	ResourceInstanceURL string        `json:"resource_instance_url"`
	ResourceAliasURL    interface{}   `json:"resource_alias_url"`
}

type CredentialSession

type CredentialSession struct {
	Token           *Token
	AccessKeyID     string
	SecretAccessKey string
	InstanceID      string
	URL             string
}

func AuthenticateFromCredentials

func AuthenticateFromCredentials(wmlInstanceID, wmlAPIKey, wmlURL, cosAccessKey, cosSecretKey string) (*CredentialSession, error)

func AuthenticateFromFile

func AuthenticateFromFile(filepath string) (*CredentialSession, error)

func (*CredentialSession) CancelRun

func (s *CredentialSession) CancelRun(modelID string) error

func (*CredentialSession) DownloadDirs

func (s *CredentialSession) DownloadDirs(bucket string, modelLocation string, modelID string, modelsToDownload []string) error

func (*CredentialSession) GetEndpointForBucket

func (s *CredentialSession) GetEndpointForBucket(bucket string) (string, error)

func (*CredentialSession) GetObject

func (s *CredentialSession) GetObject(bucket string, key string) (*s3.GetObjectOutput, error)

func (*CredentialSession) GetTrainingRun

func (s *CredentialSession) GetTrainingRun(modelID string) (*Model, error)

func (*CredentialSession) ListAllBucket

func (s *CredentialSession) ListAllBucket() (*s3.ListBucketsExtendedOutput, error)

func (*CredentialSession) ListTrainingRuns

func (s *CredentialSession) ListTrainingRuns() (*Models, error)

func (*CredentialSession) MonitorRun

func (s *CredentialSession) MonitorRun(modelID string, cb func(string)) error

func (*CredentialSession) StartTraining

func (s *CredentialSession) StartTraining(trainingZip string, projectName string, bucket *s3.BucketExtended, output *s3.BucketExtended, steps int, gpu string, framework string, frameworkVersion string, pythonVersion string) (*Model, error)

type CredentialSet

type CredentialSet struct {
	Apikey               string      `json:"apikey"`
	CosHmacKeys          CosHmacKeys `json:"cos_hmac_keys"`
	Endpoints            string      `json:"endpoints"`
	IamApikeyDescription string      `json:"iam_apikey_description"`
	IamApikeyName        string      `json:"iam_apikey_name"`
	IamRoleCrn           string      `json:"iam_role_crn"`
	IamServiceidCrn      string      `json:"iam_serviceid_crn"`
	ResourceInstanceID   string      `json:"resource_instance_id"`
}

type Credentials

type Credentials struct {
	RowsCount int          `json:"rows_count"`
	NextURL   interface{}  `json:"next_url"`
	Resources []Credential `json:"resources"`
}

type Entity

type Entity struct {
	Name                 string                 `json:"name"`
	Type                 string                 `json:"type"`
	State                string                 `json:"state"`
	Owner                string                 `json:"owner"`
	OwnerUserid          string                 `json:"owner_userid"`
	OwnerUniqueID        string                 `json:"owner_unique_id"`
	OwnerIamID           string                 `json:"owner_iam_id"`
	CustomerID           string                 `json:"customer_id"`
	CountryCode          string                 `json:"country_code"`
	CurrencyCode         string                 `json:"currency_code"`
	BillingCountryCode   string                 `json:"billing_country_code"`
	IsIBMer              bool                   `json:"isIBMer"`
	TermsAndConditions   TermsAndConditions     `json:"terms_and_conditions"`
	MigratedState        string                 `json:"migrated_state"`
	Tags                 []interface{}          `json:"tags"`
	TeamDirectoryEnabled bool                   `json:"team_directory_enabled"`
	OrganizationsRegion  []OrganizationsRegion  `json:"organizations_region"`
	Linkages             []Linkages             `json:"linkages"`
	Subscriptions        []Subscriptions        `json:"subscriptions"`
	BluemixSubscriptions []BluemixSubscriptions `json:"bluemix_subscriptions"`
	SubscriptionID       string                 `json:"subscription_id"`
	ConfigurationID      string                 `json:"configuration_id"`
	Onboarded            int                    `json:"onboarded"`
}

type Error

type Error struct {
	Code     string `json:"code"`
	Message  string `json:"message"`
	MoreInfo string `json:"more_info"`
	Target   Target `json:"target"`
}

type ErrorMessage

type ErrorMessage struct {
	ErrorDescription string  `json:"error_description"`
	Trace            string  `json:"trace"`
	Error            []Error `json:"error"`
	Errors           []Error `json:"errors"`
}

type Execution

type Execution struct {
	Command              string               `json:"command"`
	ComputeConfiguration ComputeConfiguration `json:"compute_configuration"`
}

type Framework

type Framework struct {
	Name     string     `json:"name"`
	Version  string     `json:"version"`
	Runtimes []Runtimes `json:"runtimes"`
}

type GetCredentialsParams

type GetCredentialsParams struct {
	Name string
	Crn  string
}

type HMACParameters

type HMACParameters struct {
	HMAC bool `json:"HMAC"`
}

type History

type History struct {
	Type               string `json:"type"`
	State              string `json:"state"`
	StartTime          string `json:"startTime"`
	EndTime            string `json:"endTime"`
	CurrencyCode       string `json:"currencyCode"`
	CountryCode        string `json:"countryCode"`
	BillingCountryCode string `json:"billingCountryCode"`
}

type IdentityEndpoints

type IdentityEndpoints struct {
	Issuer                            string   `json:"issuer"`
	AuthorizationEndpoint             string   `json:"authorization_endpoint"`
	TokenEndpoint                     string   `json:"token_endpoint"`
	PasscodeEndpoint                  string   `json:"passcode_endpoint"`
	UserinfoEndpoint                  string   `json:"userinfo_endpoint"`
	JwksURI                           string   `json:"jwks_uri"`
	ResponseTypesSupported            []string `json:"response_types_supported"`
	GrantTypesSupported               []string `json:"grant_types_supported"`
	SubjectTypesSupported             []string `json:"subject_types_supported"`
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
	IDTokenSigningAlgValuesSupported  []string `json:"id_token_signing_alg_values_supported"`
	ScopesSupported                   []string `json:"scopes_supported"`
	ClaimsSupported                   []string `json:"claims_supported"`
}

func GetIdentityEndpoints

func GetIdentityEndpoints() (*IdentityEndpoints, error)

type Linkages

type Linkages struct {
	Origin string `json:"origin"`
	State  string `json:"state"`
}

type Location

type Location struct {
	Bucket        string `json:"bucket"`
	ModelLocation string `json:"model_location"`
}

type Metadata

type Metadata struct {
	GUID      string `json:"guid"`
	URL       string `json:"url"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type Model

type Model struct {
	Metadata Metadata    `json:"metadata"`
	Entity   TrainingRun `json:"entity"`
}

type ModelDefinition

type ModelDefinition struct {
	Framework      Framework `json:"framework"`
	Name           string    `json:"name"`
	DefinitionHref string    `json:"definition_href"`
	Execution      Execution `json:"execution"`
}

type Models

type Models struct {
	Resources []Model `json:"resources"`
}

type OrganizationsRegion

type OrganizationsRegion struct {
	GUID   string `json:"guid"`
	Region string `json:"region"`
}

type PaymentMethod

type PaymentMethod struct {
	Type           string      `json:"type"`
	Started        string      `json:"started"`
	Ended          string      `json:"ended"`
	CurrencyCode   string      `json:"currencyCode"`
	AnniversaryDay interface{} `json:"anniversaryDay"` // most are int some are string...
}

type PlanHistory

type PlanHistory struct {
	ResourcePlanID string `json:"resource_plan_id"`
	StartDate      string `json:"start_date"`
	RequestorID    string `json:"requestor_id"`
}

type Resource

type Resource struct {
	ID                  string        `json:"id"`
	GUID                string        `json:"guid"`
	URL                 string        `json:"url"`
	CreatedAt           string        `json:"created_at"`
	UpdatedAt           string        `json:"updated_at"`
	DeletedAt           interface{}   `json:"deleted_at"`
	CreatedBy           string        `json:"created_by"`
	UpdatedBy           string        `json:"updated_by"`
	DeletedBy           string        `json:"deleted_by"`
	ScheduledReclaimAt  interface{}   `json:"scheduled_reclaim_at"`
	RestoredAt          interface{}   `json:"restored_at"`
	ScheduledReclaimBy  string        `json:"scheduled_reclaim_by"`
	RestoredBy          string        `json:"restored_by"`
	Name                string        `json:"name"`
	RegionID            string        `json:"region_id"`
	AccountID           string        `json:"account_id"`
	ResourcePlanID      string        `json:"resource_plan_id"`
	ResourceGroupID     string        `json:"resource_group_id"`
	ResourceGroupCrn    string        `json:"resource_group_crn"`
	TargetCrn           string        `json:"target_crn"`
	Crn                 string        `json:"crn"`
	State               string        `json:"state"`
	Type                string        `json:"type"`
	ResourceID          string        `json:"resource_id"`
	DashboardURL        string        `json:"dashboard_url"`
	LastOperation       interface{}   `json:"last_operation"`
	ResourceAliasesURL  string        `json:"resource_aliases_url"`
	ResourceBindingsURL string        `json:"resource_bindings_url"`
	ResourceKeysURL     string        `json:"resource_keys_url"`
	PlanHistory         []PlanHistory `json:"plan_history"`
	Migrated            bool          `json:"migrated"`
	ControlledBy        string        `json:"controlled_by"`
}

type Resources

type Resources struct {
	RowsCount int        `json:"rows_count"`
	NextURL   *string    `json:"next_url"`
	Resources []Resource `json:"resources"`
}

type Runtimes

type Runtimes struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type Session

type Session struct {
	Token *Token
}

func Authenticate

func Authenticate(otp string) (*Session, error)

func (*Session) BindAccountToToken

func (s *Session) BindAccountToToken(account Account) (*AccountSession, error)

func (*Session) GetAccounts

func (s *Session) GetAccounts() (*Accounts, error)

func (*Session) GetAccountsWithEndpoint

func (s *Session) GetAccountsWithEndpoint(nextURL *string) (*Accounts, error)

type SocketMessage

type SocketMessage struct {
	Status SocketMessageStatus `json:"status"`
}

type SocketMessageStatus

type SocketMessageStatus struct {
	CurrentAt   time.Time `json:"current_at"`
	SubmittedAt time.Time `json:"submitted_at"`
	State       string    `json:"state"`
	Message     string    `json:"message"`
}

type Status

type Status struct {
	State       string        `json:"state"`
	FinishedAt  time.Time     `json:"finished_at"`
	SubmittedAt time.Time     `json:"submitted_at"`
	RunningAt   time.Time     `json:"running_at"`
	Message     string        `json:"message"`
	Metrics     []interface{} `json:"metrics"`
	CurrentAt   string        `json:"current_at"`
}

type Subscriptions

type Subscriptions struct {
	PlanID                       string `json:"planId"`
	PartNumber                   string `json:"partNumber"`
	AccountID                    string `json:"accountId"`
	StartDate                    string `json:"startDate"`
	EndDate                      string `json:"endDate"`
	NumberOfInstancesAllowed     string `json:"numberOfInstancesAllowed"`
	OrderReferenceNumber         string `json:"orderReferenceNumber"`
	AddedBy                      string `json:"addedBy"`
	GUID                         string `json:"guid"`
	NumberOfInstancesProvisioned string `json:"numberOfInstancesProvisioned,omitempty"`
}

type Target

type Target struct {
	Type string `json:"type"`
	Name string `json:"name"`
}

type TermsAndConditions

type TermsAndConditions struct {
	Accepted  bool   `json:"accepted"`
	Timestamp string `json:"timestamp"`
}

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	Expiration   int    `json:"expiration"`
	Scope        string `json:"scope"`
}

type TrainingDataReference

type TrainingDataReference struct {
	Type       string     `json:"type"`
	Connection Connection `json:"connection"`
	Location   Location   `json:"location"`
}

type TrainingDef

type TrainingDef struct {
	Name                      string                    `json:"name"`
	Framework                 Framework                 `json:"framework"`
	TrainingDefinitionVersion TrainingDefinitionVersion `json:"training_definition_version"`
}

type TrainingDefinition

type TrainingDefinition struct {
	Framework Framework `json:"framework"`
	Name      string    `json:"name"`
}

type TrainingDefinitionRes

type TrainingDefinitionRes struct {
	Metadata Metadata    `json:"metadata"`
	Entity   TrainingDef `json:"entity"`
}

type TrainingDefinitionVersion

type TrainingDefinitionVersion struct {
	GUID          string        `json:"guid"`
	URL           string        `json:"url"`
	ContentURL    string        `json:"content_url"`
	ContentStatus ContentStatus `json:"content_status"`
}

type TrainingResultsReference

type TrainingResultsReference struct {
	Type       string     `json:"type"`
	Connection Connection `json:"connection"`
	Location   Location   `json:"location"`
}

type TrainingRun

type TrainingRun struct {
	ModelDefinition          ModelDefinition          `json:"model_definition"`
	TrainingDataReference    TrainingDataReference    `json:"training_data_reference"`
	TrainingResultsReference TrainingResultsReference `json:"training_results_reference"`
	Status                   Status                   `json:"status"`
}

type TrainingScriptRes

type TrainingScriptRes struct {
	Ok string `json:"ok"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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