Documentation ¶
Overview ¶
Package conoha implements ConoHa API client
Index ¶
- type Access
- type BillingInvoice
- type BillingInvoiceItem
- type ComputeFlavor
- type ComputeImage
- type ComputeImageMetadata
- type ComputeSecurityGroup
- type ComputeServer
- type ComputeServerAddress
- type ComputeServerLink
- type ComputeServerMetadata
- type Conoha
- func (c *Conoha) AccountAPIVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) AccountVersion(ctx context.Context) (*Version, *ResponseMeta, error)
- func (c *Conoha) AddComputeServer(ctx context.Context, ...) (*ComputeServer, *ResponseMeta, error)
- func (c *Conoha) BillingInvoice(ctx context.Context, invoiceID string) (BillingInvoice, *ResponseMeta, error)
- func (c *Conoha) BillingInvoices(ctx context.Context) ([]*BillingInvoice, *ResponseMeta, error)
- func (c *Conoha) ComputeFlavor(ctx context.Context, flavorID string) (*ComputeFlavor, *ResponseMeta, error)
- func (c *Conoha) ComputeFlavors(ctx context.Context) ([]*ComputeFlavor, *ResponseMeta, error)
- func (c *Conoha) ComputeFlavorsDetail(ctx context.Context) ([]*ComputeFlavor, *ResponseMeta, error)
- func (c *Conoha) ComputeImage(ctx context.Context, imageID string) (*ComputeImage, *ResponseMeta, error)
- func (c *Conoha) ComputeImages(ctx context.Context) ([]*ComputeImage, *ResponseMeta, error)
- func (c *Conoha) ComputeKeypair(ctx context.Context, keypairName string) (*Keypair, *ResponseMeta, error)
- func (c *Conoha) ComputeKeypairs(ctx context.Context) ([]*KeypairParent, *ResponseMeta, error)
- func (c *Conoha) ComputeServer(ctx context.Context, serverID string) (*ComputeServer, *ResponseMeta, error)
- func (c *Conoha) ComputeServers(ctx context.Context) ([]*ComputeServer, *ResponseMeta, error)
- func (c *Conoha) ComputeServersDetail(ctx context.Context) ([]*ComputeServer, *ResponseMeta, error)
- func (c *Conoha) ComputeVersion(ctx context.Context) (*Version, *ResponseMeta, error)
- func (c *Conoha) ComputeVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) DNSVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) DatabaseVersion(ctx context.Context) (*Version, *ResponseMeta, error)
- func (c *Conoha) DatabaseVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) DeleteComputeServer(ctx context.Context, serverID string) (*ResponseMeta, error)
- func (c *Conoha) ForceShutdownServer(ctx context.Context, serverID string) (*ResponseMeta, error)
- func (c *Conoha) IdentityAPIVersion(ctx context.Context) (*Version, *ResponseMeta, error)
- func (c *Conoha) IdentityAPIVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) IdentityToken(ctx context.Context) (*Access, *ResponseMeta, error)
- func (c *Conoha) ImageVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) IsoImages(ctx context.Context) ([]*IsoImage, *ResponseMeta, error)
- func (c *Conoha) MailVersion(ctx context.Context) (*Version, *ResponseMeta, error)
- func (c *Conoha) MailVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) NetworkVersion(ctx context.Context) (*Version, *ResponseMeta, error)
- func (c *Conoha) NetworkVersions(ctx context.Context) ([]*Version, *ResponseMeta, error)
- func (c *Conoha) Notification(ctx context.Context, notificationCode string) (*Notification, *ResponseMeta, error)
- func (c *Conoha) Notifications(ctx context.Context) ([]*Notification, *ResponseMeta, error)
- func (c *Conoha) OrderItem(ctx context.Context, itemID string) (*OrderItem, *ResponseMeta, error)
- func (c *Conoha) OrderItems(ctx context.Context) ([]*OrderItem, *ResponseMeta, error)
- func (c *Conoha) PaymentHistory(ctx context.Context) ([]*PaymentHistory, *ResponseMeta, error)
- func (c *Conoha) PaymentSummary(ctx context.Context) (*PaymentSummary, *ResponseMeta, error)
- func (c *Conoha) RebootComputeServer(ctx context.Context, serverID string, isSoft bool) (*ResponseMeta, error)
- func (c *Conoha) StartComputeServer(ctx context.Context, serverID string) (*ResponseMeta, error)
- func (c *Conoha) StopComputeServer(ctx context.Context, serverID string) (*ResponseMeta, error)
- type ErrUnauthorized
- type IsoImage
- type Keypair
- type KeypairParent
- type Link
- type Notification
- type OrderItem
- type PaymentHistory
- type PaymentSummary
- type ResponseMeta
- type Token
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Access ¶
type Access struct { Token *Token `json:"token"` ServiceCatalog []*serviceCatalog `json:"serviceCatalog"` User *user `json:"user"` Metadata *identityTokenMetadata `json:"metadata"` }
Access represents data contains token and metadata.
type BillingInvoice ¶
type BillingInvoice struct { Items []*BillingInvoiceItem `json:"items"` InvoiceID int `json:"invoice_id"` PaymentMethodType string `json:"payment_method_type"` InvoiceDate string `json:"invoice_date"` BillPlasTax int `json:"bill_plas_tax"` DueDate string `json:"due_date"` }
BillingInvoice represents invoice information.
type BillingInvoiceItem ¶
type BillingInvoiceItem struct { InvoiceDetailID int `json:"invoice_detail_id"` ProductName string `json:"product_name"` UnitPrice float32 `json:"unit_price"` Quantity int `json:"quantity"` StartDate string `json:"start_date"` EndDate string `json:"EndDate"` }
BillingInvoiceItem represents detailed information of the invoice.
type ComputeFlavor ¶
type ComputeFlavor struct { OsFlvDisabled bool `json:"OS-FLV-DISABLED:disabled"` OsFlvExtData int `json:"OS-FLV-EXT-DATA:ephemeral"` Disk int `json:"disk"` ID string `json:"id"` Links []*Link `json:"links"` Name string `json:"name"` OsFlavorAccessIsPublic bool `json:"os-flavor-access:is_public"` RAM int `json:"ram"` RxtxFactor int `json:"rxtx_factor"` Swap string `json:"swap"` Vcpus int `json:"vcpus"` }
ComputeFlavor represents the plan's information.
type ComputeImage ¶
type ComputeImage struct { OsExtImgSize int `json:"OS-EXT-IMG-SIZE:size"` Created string `json:"created"` ID string `json:"id"` Links []*Link `json:"links"` Metadata *ComputeImageMetadata `json:"metadata"` MinDisk int `json:"minDisk"` MinRAM int `json:"minRam"` Name string `json:"name"` Progress int `json:"progress"` Status string `json:"status"` Updated string `json:"updated"` }
ComputeImage represents the server information.
type ComputeImageMetadata ¶
type ComputeImageMetadata struct { DisplayOrder string `json:"display_order"` GncApp string `json:"gnc_app"` HwQemuGuestAgent string `json:"hw_qemu_guest_agent"` OsType string `json:"os_type"` }
ComputeImageMetadata represents metadata for the server.
type ComputeSecurityGroup ¶
type ComputeSecurityGroup struct {
Name string `json:"name,omitempty"`
}
ComputeSecurityGroup represents the security group applied to the server.
type ComputeServer ¶
type ComputeServer struct { OsDcfDiskConfig string `json:"OS-DCF:diskConfig,omitempty"` OsExtAzAvailabilityZone string `json:"OS-EXT-AZ:availability_zone,omitempty"` OsExtSrvAttrHost string `json:"OS-EXT-SRV-ATTR:host,omitempty"` OsExtSrvAttrHypervisorHostname string `json:"OS-EXT-SRV-ATTR:hypervisor_hostname,omitempty"` OsExtSrvAttrInstanceName string `json:"OS-EXT-SRV-ATTR:instance_name,omitempty"` OsExtStsPowerState int `json:"OS-EXT-STS:power_state,omitempty"` OsExtStsTaskState string `json:"OS-EXT-STS:task_state,omitempty"` OsExtStsVMState string `json:"OS-EXT-STS:vm_state,omitempty"` OsSrvUsgLaunchedAt string `json:"OS-SRV-USG:launched_at,omitempty"` OsSrvUsgTerminatedAt string `json:"OS-SRV-USG:terminated_at,omitempty"` AccessIPv4 string `json:"accessIPv4,omitempty"` AccessIPv6 string `json:"accessIPv6,omitempty"` Addresses map[string][]*ComputeServerAddress `json:"addresses,omitempty"` ConfigDrive string `json:"config_drive,omitempty"` Created string `json:"created,omitempty"` Flavor *ComputeFlavor `json:"flavor,omitempty"` HostID string `json:"hostId,omitempty"` ID string `json:"id,omitempty"` Image *ComputeImage `json:"image,omitempty"` KeyName string `json:"key_name,omitempty"` Links []*ComputeServerLink `json:"links,omitempty"` Metadata *ComputeServerMetadata `json:"metadata,omitempty"` Name string `json:"name,omitempty"` Status string `json:"status,omitempty"` TenantID string `json:"tenant_id,omitempty"` Updated string `json:"updated"` UserID string `json:"user_id"` ImageRef string `json:"imageRef,omitempty"` FlavorRef string `json:"flavorRef,omitempty"` AdminPass string `json:"adminPass,omitempty"` SecurityGroups []*ComputeSecurityGroup `json:"security_groups,omitempty"` }
ComputeServer represents the server information.
type ComputeServerAddress ¶
type ComputeServerAddress struct {
Addr string `json:"addr"`
}
ComputeServerAddress represents the server's address information.
type ComputeServerLink ¶
type ComputeServerLink struct { }
ComputeServerLink represents the link for the server.
type ComputeServerMetadata ¶
type ComputeServerMetadata struct { BackupID string `json:"backup_id"` BackupSet string `json:"backup_set"` BackupStatus string `json:"backup_status"` InstanceNameTag string `json:"instance_name_tag"` Properties string `json:"properties"` }
ComputeServerMetadata represents the metadata for the server.
type Conoha ¶
type Conoha struct { IdentityServiceURL string AccountServiceURL string ComputeServiceURL string BlockStorageServiceURL string ImageServiceURL string NetworkServiceURL string ObjectStorageServiceURL string DatabaseServiceURL string DNSServiceURL string MailServiceURL string Username string Password string TenantID string Token string Client *http.Client }
Conoha represents ConoHa APi Client.
ConoHa API docs: https://www.conoha.jp/docs/
func NewConoha ¶
func NewConoha( identityServiceURL, accountServiceURL, computeServiceURL, blockStorageServiceURL, imageServiceURL, networkServiceURL, objectStorageServiceURL, databaseServiceURL, dnsServiceURL, mailServiceURL, username, password, tenantID, token string, ) *Conoha
NewConoha creates ConoHa API client.
func (*Conoha) AccountAPIVersions ¶
AccountAPIVersions fetches Account API versions list.
ConoHa API docs: https://www.conoha.jp/docs/account-get_version_list.html
func (*Conoha) AccountVersion ¶
AccountVersion fetches the Account API information.
ConoHa API docs: https://www.conoha.jp/docs/account-get_version_detail.html
func (*Conoha) AddComputeServer ¶
func (c *Conoha) AddComputeServer( ctx context.Context, imageRef, flavorRef, adminPass, keyName, securityGroupName string, ) (*ComputeServer, *ResponseMeta, error)
AddComputeServer adds new server.
ConoHa API docs: https://www.conoha.jp/docs/compute-create_vm.html
func (*Conoha) BillingInvoice ¶
func (c *Conoha) BillingInvoice(ctx context.Context, invoiceID string) (BillingInvoice, *ResponseMeta, error)
BillingInvoice fetches invoice information.
ConoHa API docs: https://www.conoha.jp/docs/account-billing-invoices-detail-specified.html
func (*Conoha) BillingInvoices ¶
func (c *Conoha) BillingInvoices(ctx context.Context) ([]*BillingInvoice, *ResponseMeta, error)
BillingInvoices fetches invoices list.
ConoHa API docs: https://www.conoha.jp/docs/account-billing-invoices-list.html
func (*Conoha) ComputeFlavor ¶
func (c *Conoha) ComputeFlavor(ctx context.Context, flavorID string) (*ComputeFlavor, *ResponseMeta, error)
ComputeFlavor fetches the plan's information.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_flavors_detail_specified.html
func (*Conoha) ComputeFlavors ¶
func (c *Conoha) ComputeFlavors(ctx context.Context) ([]*ComputeFlavor, *ResponseMeta, error)
ComputeFlavors fetches plans list.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_flavors_list.html
func (*Conoha) ComputeFlavorsDetail ¶
func (c *Conoha) ComputeFlavorsDetail(ctx context.Context) ([]*ComputeFlavor, *ResponseMeta, error)
ComputeFlavorsDetail fetches detailed plans list.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_flavors_detail.html
func (*Conoha) ComputeImage ¶
func (c *Conoha) ComputeImage(ctx context.Context, imageID string) (*ComputeImage, *ResponseMeta, error)
ComputeImage fetches summarized information of the server.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_images_detail_specified.html
func (*Conoha) ComputeImages ¶
func (c *Conoha) ComputeImages(ctx context.Context) ([]*ComputeImage, *ResponseMeta, error)
ComputeImages fetches server images list.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_images_list.html
func (*Conoha) ComputeKeypair ¶
func (c *Conoha) ComputeKeypair(ctx context.Context, keypairName string) (*Keypair, *ResponseMeta, error)
ComputeKeypair fetches the key pair information.
https://www.conoha.jp/docs/compute-get_keypairs_detail_specified.html
func (*Conoha) ComputeKeypairs ¶
func (c *Conoha) ComputeKeypairs(ctx context.Context) ([]*KeypairParent, *ResponseMeta, error)
ComputeKeypairs fetches key pairs list.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_keypairs.html
func (*Conoha) ComputeServer ¶
func (c *Conoha) ComputeServer(ctx context.Context, serverID string) (*ComputeServer, *ResponseMeta, error)
ComputeServer fetches the server information.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_vms_detail_specified.html
func (*Conoha) ComputeServers ¶
func (c *Conoha) ComputeServers(ctx context.Context) ([]*ComputeServer, *ResponseMeta, error)
ComputeServers fetches servers list. Each information is summarized.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_vms_list.html
func (*Conoha) ComputeServersDetail ¶
func (c *Conoha) ComputeServersDetail(ctx context.Context) ([]*ComputeServer, *ResponseMeta, error)
ComputeServersDetail fetches server's detailed information (e.g. IP address).
ConoHa API docs: https://www.conoha.jp/docs/compute-get_vms_detail_specified.html
func (*Conoha) ComputeVersion ¶
ComputeVersion fetches Compute API information.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_version_detail.html
func (*Conoha) ComputeVersions ¶
ComputeVersions fetches Compute API versions list.
ConoHa API docs: https://www.conoha.jp/docs/compute-get_version_list.html
func (*Conoha) DNSVersions ¶
DNSVersions fetches DNS API versions list.
ConoHa API docs: https://www.conoha.jp/docs/paas-dns-get-version-list.html
func (*Conoha) DatabaseVersion ¶
DatabaseVersion fetches Database API information.
ConoHa API docs: https://www.conoha.jp/docs/paas-database-get-version-detail.html
func (*Conoha) DatabaseVersions ¶
DatabaseVersions fetches Database API versions list.
ConoHa API docs: https://www.conoha.jp/docs/paas-database-get-version-list.html
func (*Conoha) DeleteComputeServer ¶
DeleteComputeServer deletes the server.
ConoHa API docs: https://www.conoha.jp/docs/compute-delete_vm.html
func (*Conoha) ForceShutdownServer ¶
ForceShutdownServer shutdowns the server forcefully.
ConoHa API docs: https://www.conoha.jp/docs/compute-stop_forcibly_vm.html
func (*Conoha) IdentityAPIVersion ¶
IdentityAPIVersion fetches Identity API information.
ConoHa API docs: https://www.conoha.jp/docs/identity-get_version_detail.html
func (*Conoha) IdentityAPIVersions ¶
IdentityAPIVersions fetches Identity API versions list.
ConoHa API docs: https://www.conoha.jp/docs/identity-get_version_list.html
func (*Conoha) IdentityToken ¶
IdentityToken issues ConoHa API access token.
ConoHa API docs: https://www.conoha.jp/docs/identity-post_tokens.html
func (*Conoha) ImageVersions ¶
ImageVersions fetches Image API versions list.
ConoHa API docs: https://www.conoha.jp/docs/image-get_version_list.html
func (*Conoha) IsoImages ¶
IsoImages fetches ISO images list.
ConoHa API docs: https://www.conoha.jp/docs/compute-iso-list-show.html
func (*Conoha) MailVersion ¶
MailVersion fetches Mail API information.
ConoHa API docs: https://www.conoha.jp/docs/paas-mail-get-version-detail.html
func (*Conoha) MailVersions ¶
MailVersions fetches Mail API versions list.
ConoHa API docs: https://www.conoha.jp/docs/paas-mail-get-version-list.html
func (*Conoha) NetworkVersion ¶
NetworkVersion fetches Network API information.
ConoHa API docs: https://www.conoha.jp/docs/neutron-get_version_detail.html
func (*Conoha) NetworkVersions ¶
NetworkVersions fetches Network API versions list.
ConoHa API docs: https://www.conoha.jp/docs/neutron-get_version_list.html
func (*Conoha) Notification ¶
func (c *Conoha) Notification(ctx context.Context, notificationCode string) (*Notification, *ResponseMeta, error)
Notification fetches notifications list.
ConoHa API docs: https://www.conoha.jp/docs/account-informations-detail-specified.html
func (*Conoha) Notifications ¶
func (c *Conoha) Notifications(ctx context.Context) ([]*Notification, *ResponseMeta, error)
Notifications fetches notifications list for the user.
ConoHa API docs: https://www.conoha.jp/docs/account-informations-list.html
func (*Conoha) OrderItem ¶
OrderItem fetches the order's detailed information.
ConoHa API docs: https://www.conoha.jp/docs/account-order-item-detail-specified.html
func (*Conoha) OrderItems ¶
OrderItems fetches the orders list.
ConoHa API docs: https://www.conoha.jp/docs/account-order-item-list.html
func (*Conoha) PaymentHistory ¶
func (c *Conoha) PaymentHistory(ctx context.Context) ([]*PaymentHistory, *ResponseMeta, error)
PaymentHistory fetches payment history.
ConoHa API docs: https://www.conoha.jp/docs/account-payment-histories.html
func (*Conoha) PaymentSummary ¶
func (c *Conoha) PaymentSummary(ctx context.Context) (*PaymentSummary, *ResponseMeta, error)
PaymentSummary fetches summarized information of the payment.
ConoHa API docs: https://www.conoha.jp/docs/account-payment-summary.html
func (*Conoha) RebootComputeServer ¶
func (c *Conoha) RebootComputeServer(ctx context.Context, serverID string, isSoft bool) (*ResponseMeta, error)
RebootComputeServer reboots the server.
ConoHa API docs: https://www.conoha.jp/docs/compute-reboot_vm.html
func (*Conoha) StartComputeServer ¶
StartComputeServer starts the serer.
ConoHa API docs: https://www.conoha.jp/docs/compute-power_on_vm.html
func (*Conoha) StopComputeServer ¶
StopComputeServer stops the server.
ConoHa API docs: https://www.conoha.jp/docs/compute-stop_cleanly_vm.html
type ErrUnauthorized ¶
type ErrUnauthorized struct {
// contains filtered or unexported fields
}
ErrUnauthorized will used when unauthorized response returned.
func (*ErrUnauthorized) Error ¶
func (e *ErrUnauthorized) Error() string
type IsoImage ¶
type IsoImage struct { URL string `json:"url"` Path string `json:"path"` Ctime string `json:"ctime"` Name string `json:"name"` Size int `json:"size"` }
IsoImage represents ISO image.
type Keypair ¶
type Keypair struct { PublicKey string `json:"public_key"` UserID string `json:"user_id"` Name string `json:"name"` Deleted bool `json:"deleted"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` FingerPrint string `json:"fingerprint"` DeletedAt string `json:"deleted_at"` ID int `json:"id"` }
Keypair represents key pair information.
type KeypairParent ¶
type KeypairParent struct {
Value *Keypair `json:"keypair"`
}
KeypairParent represents keypair data wrapper.
type Notification ¶
type Notification struct { NotificationCode int `json:"notification_code"` Title string `json:"title"` Type string `json:"type"` Contents string `json:"contents"` ReadStatus string `json:"read_status"` StartDate string `json:"start_date"` }
Notification represents notification from ConoHa to the users.
type OrderItem ¶
type OrderItem struct { UUID string `json:"uu_id"` ServiceName string `json:"service_name"` ProductName string `json:"product_name"` Status string `json:"status"` UnitPrice float32 `json:"unit_price"` ServiceStartDate string `json:"service_start_date"` BillStartDate string `json:"bill_start_date"` CancelDate string `json:"cancel_date"` }
OrderItem represents the services/products ordered by the user.
type PaymentHistory ¶
type PaymentHistory struct { MoneyType string `json:"money_type"` DepositAmount int `json:"deposit_amount"` ReceivedDate string `json:"received_date"` }
PaymentHistory represents payment history.
type PaymentSummary ¶
type PaymentSummary struct {
TotalDepositAmount int `json:"total_deposit_amount"`
}
PaymentSummary represencts summarized information of the payment.
type ResponseMeta ¶
ResponseMeta represents response information (i.e status code).
Source Files ¶
- account_api_versions.go
- account_billing_invoice.go
- account_billing_invoices.go
- account_notification.go
- account_notifications.go
- account_order_item.go
- account_order_items.go
- account_payment_history.go
- account_payment_summary.go
- account_version.go
- block_storage_versions.go
- compute_flavor.go
- compute_flavors.go
- compute_flavors_detail.go
- compute_force_shutdown.go
- compute_get_backup.go
- compute_get_backups.go
- compute_get_iso_images.go
- compute_image.go
- compute_images.go
- compute_keypair.go
- compute_keypairs.go
- compute_server.go
- compute_servers.go
- compute_servers_detail.go
- compute_version.go
- compute_versions.go
- conoha.go
- database_version.go
- database_versions.go
- dns_versions.go
- doc.go
- errors.go
- identity_api_version.go
- identity_api_versions.go
- identity_token.go
- image_versions.go
- link.go
- mail_version.go
- mail_versions.go
- media_type.go
- network_version.go
- network_versions.go
- version.go