Documentation
¶
Overview ¶
Package cloud — вызовы API cloud.ru поверх клиентов internal/gen. Запрос собирает сгенерированный клиент; ответ 2xx отдаётся телом как есть — вывод --json без потерь полей, которых нет в спецификации; не 2xx — *APIError.
Index ¶
- Variables
- func IsNotFound(err error) bool
- func ParseOperation(raw []byte) (op operation.Operation, ok bool)
- func ParseVPCOperation(raw []byte) (op operation.Operation, ok bool)
- func PollError(err error) error
- type APIError
- type ClickHouse
- func (h *ClickHouse) Cluster(ctx context.Context, id string) ([]byte, error)
- func (h *ClickHouse) ClusterOperations(ctx context.Context, id string) ([]byte, error)
- func (h *ClickHouse) Clusters(ctx context.Context, project string) ([]byte, error)
- func (h *ClickHouse) CreateCluster(ctx context.Context, c ClickHouseClusterCreate) ([]byte, error)
- func (h *ClickHouse) CreateDatabase(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *ClickHouse) CreateUser(ctx context.Context, cluster, name, password string, roles []string) ([]byte, error)
- func (h *ClickHouse) Database(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *ClickHouse) Databases(ctx context.Context, cluster string) ([]byte, error)
- func (h *ClickHouse) DeleteCluster(ctx context.Context, id string) ([]byte, error)
- func (h *ClickHouse) DeleteDatabase(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *ClickHouse) DeleteUser(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *ClickHouse) GrantRole(ctx context.Context, cluster, name, role string) ([]byte, error)
- func (h *ClickHouse) Operation(ctx context.Context, id string) ([]byte, error)
- func (h *ClickHouse) Operations() operation.Getter
- func (h *ClickHouse) ProbeProject(ctx context.Context, project string) ([]byte, error)
- func (h *ClickHouse) RevokeRole(ctx context.Context, cluster, name, role string) ([]byte, error)
- func (h *ClickHouse) Roles(ctx context.Context, cluster string) ([]byte, error)
- func (h *ClickHouse) Specs(ctx context.Context, f ClickHouseSpecFilter) ([]byte, error)
- func (h *ClickHouse) UpdateCluster(ctx context.Context, id string, u ClickHouseClusterUpdate) ([]byte, error)
- func (h *ClickHouse) UpdateUser(ctx context.Context, cluster, name string, password *string, roles []string) ([]byte, error)
- func (h *ClickHouse) User(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *ClickHouse) Users(ctx context.Context, cluster string) ([]byte, error)
- func (h *ClickHouse) Versions(ctx context.Context) ([]byte, error)
- type ClickHouseClusterCreate
- type ClickHouseClusterUpdate
- type ClickHouseConfig
- type ClickHouseKeeper
- type ClickHouseSpecFilter
- type ClickHouseTopology
- type Compute
- func (c *Compute) CreateSubnet(ctx context.Context, s SubnetCreate) ([]byte, error)
- func (c *Compute) DeleteSubnet(ctx context.Context, id string) ([]byte, error)
- func (c *Compute) Subnet(ctx context.Context, id string) ([]byte, error)
- func (c *Compute) Subnets(ctx context.Context, f SubnetFilter) ([]byte, error)
- func (c *Compute) Zones(ctx context.Context) ([]byte, error)
- type IAM
- func (s *IAM) AccessKey(ctx context.Context, account, id string) ([]byte, error)
- func (s *IAM) AccessKeys(ctx context.Context, account string) ([]byte, error)
- func (s *IAM) CreateAccessKey(ctx context.Context, account, description, ttl string) ([]byte, error)
- func (s *IAM) CreateServiceAccount(ctx context.Context, project, name, description string) ([]byte, error)
- func (s *IAM) DeleteAccessKey(ctx context.Context, account, id string) ([]byte, error)
- func (s *IAM) DeleteServiceAccount(ctx context.Context, id string) ([]byte, error)
- func (s *IAM) Grant(ctx context.Context, project, subject, role, expires string) ([]byte, error)
- func (s *IAM) Permission(ctx context.Context, id string) ([]byte, error)
- func (s *IAM) Permissions(ctx context.Context, filter string) ([]byte, error)
- func (s *IAM) Revoke(ctx context.Context, id string) ([]byte, error)
- func (s *IAM) ServiceAccount(ctx context.Context, id string) ([]byte, error)
- func (s *IAM) ServiceAccounts(ctx context.Context, project string) ([]byte, error)
- type Kafka
- func (k *Kafka) Cluster(ctx context.Context, id string) ([]byte, error)
- func (k *Kafka) ClusterOperations(ctx context.Context, id string) ([]byte, error)
- func (k *Kafka) Clusters(ctx context.Context, project string) ([]byte, error)
- func (k *Kafka) CreateCluster(ctx context.Context, c KafkaClusterCreate) ([]byte, error)
- func (k *Kafka) CreateTopic(ctx context.Context, cluster, name string, partitions, replication int32, ...) ([]byte, error)
- func (k *Kafka) CreateUser(ctx context.Context, cluster, name, password string, roles []string) ([]byte, error)
- func (k *Kafka) DeleteCluster(ctx context.Context, id string) ([]byte, error)
- func (k *Kafka) DeleteTopic(ctx context.Context, cluster, name string) ([]byte, error)
- func (k *Kafka) DeleteUser(ctx context.Context, cluster, name string) ([]byte, error)
- func (k *Kafka) Operation(ctx context.Context, id string) ([]byte, error)
- func (k *Kafka) Operations() operation.Getter
- func (k *Kafka) Roles(ctx context.Context, cluster string) ([]byte, error)
- func (k *Kafka) Specs(ctx context.Context, f KafkaSpecFilter) ([]byte, error)
- func (k *Kafka) Topic(ctx context.Context, cluster, name string) ([]byte, error)
- func (k *Kafka) Topics(ctx context.Context, cluster, filter string) ([]byte, error)
- func (k *Kafka) UpdateCluster(ctx context.Context, id string, u KafkaClusterUpdate) ([]byte, error)
- func (k *Kafka) UpdateTopic(ctx context.Context, cluster, name string, u KafkaTopicUpdate) ([]byte, error)
- func (k *Kafka) UpdateUser(ctx context.Context, cluster, name string, password *string, roles []string) ([]byte, error)
- func (k *Kafka) User(ctx context.Context, cluster, name string) ([]byte, error)
- func (k *Kafka) Users(ctx context.Context, cluster string) ([]byte, error)
- func (k *Kafka) Versions(ctx context.Context) ([]byte, error)
- type KafkaClusterCreate
- type KafkaClusterUpdate
- type KafkaController
- type KafkaSpecFilter
- type KafkaTopicUpdate
- type KafkaTopology
- type Logging
- type OpenSearch
- func (h *OpenSearch) Cluster(ctx context.Context, id string) ([]byte, error)
- func (h *OpenSearch) ClusterOperations(ctx context.Context, id string) ([]byte, error)
- func (h *OpenSearch) Clusters(ctx context.Context, project string) ([]byte, error)
- func (h *OpenSearch) CreateCluster(ctx context.Context, c OpenSearchClusterCreate) ([]byte, error)
- func (h *OpenSearch) CreateSnapshot(ctx context.Context, cluster, name string, extra []byte) ([]byte, error)
- func (h *OpenSearch) DeleteCluster(ctx context.Context, id string) ([]byte, error)
- func (h *OpenSearch) DeleteSnapshot(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *OpenSearch) Operation(ctx context.Context, id string) ([]byte, error)
- func (h *OpenSearch) Operations() operation.Getter
- func (h *OpenSearch) Snapshot(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *OpenSearch) Snapshots(ctx context.Context, cluster string) ([]byte, error)
- func (h *OpenSearch) Spec(ctx context.Context, id string) ([]byte, error)
- func (h *OpenSearch) Specs(ctx context.Context, f OpenSearchSpecFilter) ([]byte, error)
- func (h *OpenSearch) UpdateCluster(ctx context.Context, id string, u OpenSearchClusterUpdate) ([]byte, error)
- func (h *OpenSearch) Versions(ctx context.Context) ([]byte, error)
- type OpenSearchClusterCreate
- type OpenSearchClusterUpdate
- type OpenSearchRestore
- type OpenSearchSchedule
- type OpenSearchSpecFilter
- type OpenSearchTopology
- type Options
- type PostgreSQL
- func (h *PostgreSQL) Backup(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *PostgreSQL) Backups(ctx context.Context, cluster string) ([]byte, error)
- func (h *PostgreSQL) Cluster(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) ClusterLocales(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) ClusterOperations(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) ClusterStorageInfo(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) Clusters(ctx context.Context, project string) ([]byte, error)
- func (h *PostgreSQL) CreateBackup(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *PostgreSQL) CreateCluster(ctx context.Context, c PostgreSQLClusterCreate) ([]byte, error)
- func (h *PostgreSQL) CreateDatabase(ctx context.Context, cluster string, c PostgreSQLDatabaseCreate) ([]byte, error)
- func (h *PostgreSQL) CreateUser(ctx context.Context, cluster, name, password string, extra []byte) ([]byte, error)
- func (h *PostgreSQL) Database(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *PostgreSQL) Databases(ctx context.Context, cluster string) ([]byte, error)
- func (h *PostgreSQL) DeleteCluster(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) DeleteDatabase(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *PostgreSQL) DeleteUser(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *PostgreSQL) Operation(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) Operations() operation.Getter
- func (h *PostgreSQL) ResumeCluster(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) Specs(ctx context.Context, f PostgreSQLSpecFilter) ([]byte, error)
- func (h *PostgreSQL) SuspendCluster(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) SwitchoverCluster(ctx context.Context, id string) ([]byte, error)
- func (h *PostgreSQL) UpdateCluster(ctx context.Context, id string, u PostgreSQLClusterUpdate) ([]byte, error)
- func (h *PostgreSQL) UpdateUser(ctx context.Context, cluster, name string, password *string, roles []string, ...) ([]byte, error)
- func (h *PostgreSQL) User(ctx context.Context, cluster, name string) ([]byte, error)
- func (h *PostgreSQL) Users(ctx context.Context, cluster string) ([]byte, error)
- func (h *PostgreSQL) VersionLocales(ctx context.Context, version string) ([]byte, error)
- func (h *PostgreSQL) Versions(ctx context.Context) ([]byte, error)
- type PostgreSQLBackup
- type PostgreSQLClusterCreate
- type PostgreSQLClusterUpdate
- type PostgreSQLDatabaseCreate
- type PostgreSQLRecovery
- type PostgreSQLSpecFilter
- type PostgreSQLTopology
- type Redis
- func (r *Redis) Cluster(ctx context.Context, id string) ([]byte, error)
- func (r *Redis) ClusterOperations(ctx context.Context, id string) ([]byte, error)
- func (r *Redis) Clusters(ctx context.Context, project string) ([]byte, error)
- func (r *Redis) CreateCluster(ctx context.Context, c RedisClusterCreate) ([]byte, error)
- func (r *Redis) CreateUser(ctx context.Context, cluster, name, password string, roles []string) ([]byte, error)
- func (r *Redis) DeleteCluster(ctx context.Context, id string) ([]byte, error)
- func (r *Redis) DeleteUser(ctx context.Context, cluster, name string) ([]byte, error)
- func (r *Redis) Operation(ctx context.Context, id string) ([]byte, error)
- func (r *Redis) Operations() operation.Getter
- func (r *Redis) Roles(ctx context.Context, cluster string) ([]byte, error)
- func (r *Redis) Specs(ctx context.Context, f RedisSpecFilter) ([]byte, error)
- func (r *Redis) UpdateCluster(ctx context.Context, id string, u RedisClusterUpdate) ([]byte, error)
- func (r *Redis) UpdateUser(ctx context.Context, cluster, name string, password *string, roles []string) ([]byte, error)
- func (r *Redis) User(ctx context.Context, cluster, name string) ([]byte, error)
- func (r *Redis) Users(ctx context.Context, cluster string) ([]byte, error)
- func (r *Redis) Versions(ctx context.Context) ([]byte, error)
- type RedisClusterCreate
- type RedisClusterUpdate
- type RedisSpecFilter
- type SubnetCreate
- type SubnetFilter
- type VPC
- func (v *VPC) Create(ctx context.Context, req VPCCreate) ([]byte, error)
- func (v *VPC) Delete(ctx context.Context, id string) ([]byte, error)
- func (v *VPC) Get(ctx context.Context, id string) ([]byte, error)
- func (v *VPC) List(ctx context.Context, project string) ([]byte, error)
- func (v *VPC) Operation(ctx context.Context, id string) ([]byte, error)
- func (v *VPC) Operations() operation.Getter
- type VPCCreate
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotUUID = i18n.Sentinel("cloud.err.not_uuid") ErrBadID = i18n.Sentinel("cloud.err.bad_id") ErrBadExpires = i18n.Sentinel("cloud.err.bad_expires") )
Ошибки ввода, отказанные до запроса; текст для человека — в обёртке.
var ErrList = i18n.Sentinel("cloud.err.list")
ErrList — ответ списка, который нельзя склеить: null, нет поля, токен по кругу, предел.
Functions ¶
func ParseOperation ¶
ParseOperation разбирает ответ DBaaS в операцию; ok — в теле операция с id.
func ParseVPCOperation ¶
ParseVPCOperation разбирает операцию VPC; ok — в теле операция с id.
Types ¶
type ClickHouse ¶
type ClickHouse struct {
// contains filtered or unexported fields
}
ClickHouse — Public API Managed ClickHouse.
func NewClickHouse ¶
func NewClickHouse(server string, o Options) (*ClickHouse, error)
NewClickHouse — клиент API ClickHouse по адресу server.
func (*ClickHouse) ClusterOperations ¶
ClusterOperations — все операции кластера: {"operations": [...]}.
func (*ClickHouse) Clusters ¶
Clusters — все кластеры проекта: {"clusters": [...]} со всех страниц. page_size не отправляем: ClickHouse отвечает и без него.
func (*ClickHouse) CreateCluster ¶
func (h *ClickHouse) CreateCluster(ctx context.Context, c ClickHouseClusterCreate) ([]byte, error)
CreateCluster возвращает операцию создания.
func (*ClickHouse) CreateDatabase ¶
func (*ClickHouse) CreateUser ¶
func (h *ClickHouse) CreateUser(ctx context.Context, cluster, name, password string, roles []string) ([]byte, error)
CreateUser — пустой roles: поле не отправляется.
func (*ClickHouse) DeleteCluster ¶
DeleteCluster возвращает операцию удаления.
func (*ClickHouse) DeleteDatabase ¶
func (*ClickHouse) DeleteUser ¶
func (*ClickHouse) Operations ¶
func (h *ClickHouse) Operations() operation.Getter
Operations — опрос операций ClickHouse для operation.Waiter.
func (*ClickHouse) ProbeProject ¶
ProbeProject — первая страница из одного кластера: проверка доступа к проекту.
func (*ClickHouse) RevokeRole ¶
func (*ClickHouse) Specs ¶
func (h *ClickHouse) Specs(ctx context.Context, f ClickHouseSpecFilter) ([]byte, error)
Specs — спецификации; Role — server | keeper | "" (не отправлять).
func (*ClickHouse) UpdateCluster ¶
func (h *ClickHouse) UpdateCluster(ctx context.Context, id string, u ClickHouseClusterUpdate) ([]byte, error)
UpdateCluster возвращает операцию изменения.
func (*ClickHouse) UpdateUser ¶
func (h *ClickHouse) UpdateUser(ctx context.Context, cluster, name string, password *string, roles []string) ([]byte, error)
UpdateUser — nil password: не менять, пустой roles: не менять.
type ClickHouseClusterCreate ¶
type ClickHouseClusterCreate struct {
Project, Name, Description, Version, Spec, KeeperMode string
Shards, Replicas, StorageGiB int32
Subnets []string
Keeper ClickHouseKeeper
Config *ClickHouseConfig
Logging Logging
Body []byte
}
ClickHouseClusterCreate — новый кластер; KeeperMode — embedded | standalone | "" (legacy). Body — сырой JSON поверх собранного: ключи верхнего уровня заменяют поля.
func (ClickHouseClusterCreate) Topology ¶ added in v0.4.0
func (c ClickHouseClusterCreate) Topology() (ClickHouseTopology, error)
Topology заменяет standalone_keeper целиком, без слияния его вложенных полей.
type ClickHouseClusterUpdate ¶
type ClickHouseClusterUpdate struct {
Spec string
StorageGiB int32
Keeper ClickHouseKeeper
Config *ClickHouseConfig
Body []byte
}
ClickHouseClusterUpdate — изменение кластера; нулевые поля не отправляются.
type ClickHouseConfig ¶
type ClickHouseConfig = clickhouse.CloudruDbaasClickhouseV1ClusterConfig
ClickHouseConfig — серверные параметры кластера.
func ParseClickHouseConfig ¶
func ParseClickHouseConfig(flag string, kvs map[string]string) (*ClickHouseConfig, error)
ParseClickHouseConfig — --config ключ=число. Неизвестный ключ отклоняется по полям структуры, а не молча теряется.
type ClickHouseKeeper ¶
ClickHouseKeeper — выделенный Keeper (standalone_keeper); пустой — поле не отправляется.
type ClickHouseSpecFilter ¶ added in v0.4.0
type ClickHouseSpecFilter struct {
Version, Zone, Role, Cluster string
}
ClickHouseSpecFilter — версия, зона и роль либо кластер для вертикального масштабирования.
type ClickHouseTopology ¶ added in v0.4.0
type ClickHouseTopology struct {
Shards, Replicas, KeeperStorageGiB *int32
Subnets *[]string
KeeperMode, KeeperSpec *string
}
ClickHouseTopology — итоговая топология Keeper; поля неверного типа имеют nil.
type Compute ¶
type Compute struct {
// contains filtered or unexported fields
}
Compute — API виртуальных машин: подсети и зоны. Идентификаторы в нём — UUID, не UUID отказываем до запроса.
func NewCompute ¶
NewCompute — клиент API виртуальных машин по адресу server.
func (*Compute) CreateSubnet ¶
CreateSubnet создаёт подсеть. Зона — только id: availability_zone_name в спецификации есть, но API его отвергает (422 extra_forbidden, 14.10). Зона и VPC в теле — строки по спецификации, их формат проверяет API; UUID — только там, где его требует сгенерированный клиент (проект, путь, фильтр списка).
func (*Compute) DeleteSubnet ¶
type IAM ¶
type IAM struct {
// contains filtered or unexported fields
}
IAM — сервисные аккаунты, их ключи доступа и роли в проекте. Отвечает snake_case, хотя в спецификации camelCase, — тела ответов не разбираем сгенерированными типами (docs/api-coverage.md, «Расхождения»).
func (*IAM) AccessKeys ¶
func (*IAM) CreateAccessKey ¶
func (s *IAM) CreateAccessKey(ctx context.Context, account, description, ttl string) ([]byte, error)
CreateAccessKey выпускает ключ; секрет — в ответе, один раз. Пустые description и ttl не отправляются.
func (*IAM) CreateServiceAccount ¶
func (s *IAM) CreateServiceAccount(ctx context.Context, project, name, description string) ([]byte, error)
CreateServiceAccount — аккаунт name в проекте project; description "" — без описания.
func (*IAM) DeleteAccessKey ¶
func (*IAM) DeleteServiceAccount ¶
func (*IAM) Grant ¶
Grant выдаёт роль role субъекту subject в проекте project; expires — RFC 3339 или "" (бессрочно).
func (*IAM) Permissions ¶
Permissions — выданные роли по фильтру IAM, все страницы.
func (*IAM) ServiceAccount ¶
type Kafka ¶
type Kafka struct {
// contains filtered or unexported fields
}
Kafka — Public API Managed Kafka.
func (*Kafka) ClusterOperations ¶
ClusterOperations — все операции кластера: {"operations": [...]}.
func (*Kafka) CreateCluster ¶
CreateCluster возвращает операцию создания.
func (*Kafka) CreateTopic ¶
func (k *Kafka) CreateTopic(ctx context.Context, cluster, name string, partitions, replication int32, params map[string]string) ([]byte, error)
CreateTopic возвращает операцию; params уходят всегда, пустые — «{}» (поле обязательно).
func (*Kafka) CreateUser ¶
func (k *Kafka) CreateUser(ctx context.Context, cluster, name, password string, roles []string) ([]byte, error)
CreateUser возвращает операцию; пустой roles — поле не отправляется.
func (*Kafka) DeleteCluster ¶
DeleteCluster возвращает операцию удаления.
func (*Kafka) DeleteTopic ¶
func (*Kafka) DeleteUser ¶
func (*Kafka) Operations ¶
Operations — опрос операций Kafka для operation.Waiter.
func (*Kafka) UpdateCluster ¶
UpdateCluster возвращает операцию изменения.
func (*Kafka) UpdateTopic ¶
func (k *Kafka) UpdateTopic(ctx context.Context, cluster, name string, u KafkaTopicUpdate) ([]byte, error)
UpdateTopic возвращает операцию изменения.
func (*Kafka) UpdateUser ¶
func (k *Kafka) UpdateUser(ctx context.Context, cluster, name string, password *string, roles []string) ([]byte, error)
UpdateUser возвращает операцию: nil password — не менять, пустой roles — не менять.
type KafkaClusterCreate ¶
type KafkaClusterCreate struct {
Project, Name, Description, Version, Spec string
Subnets []string
Controller KafkaController
Brokers, StorageGiB int32
UI, CruiseControl, AutoRebalance bool
Params map[string]string
Logging Logging
Body []byte
}
KafkaClusterCreate — новый кластер. Body — сырой JSON поверх собранного: ключи верхнего уровня заменяют поля.
func (KafkaClusterCreate) Topology ¶ added in v0.4.0
func (c KafkaClusterCreate) Topology() (KafkaTopology, error)
Topology учитывает замену верхних ключей --body, как mergeBody.
type KafkaClusterUpdate ¶
type KafkaClusterUpdate struct {
Controller KafkaController
Spec string
StorageGiB int32
Params map[string]string
Body []byte
}
KafkaClusterUpdate — изменение кластера; нулевые поля не отправляются.
type KafkaController ¶ added in v0.4.0
KafkaController — спецификация и диск выделенных контроллеров; пустой — комбинированный режим.
type KafkaSpecFilter ¶
type KafkaSpecFilter struct {
Version, Zone, Cluster string
}
KafkaSpecFilter — отбор спецификаций: версия и зона или кластер (для resize).
type KafkaTopicUpdate ¶
KafkaTopicUpdate — изменение топика; нулевые поля не отправляются.
type KafkaTopology ¶ added in v0.4.0
KafkaTopology — итоговые поля для проверки топологии. nil означает неверный тип в --body: зависимые от поля правила оставляются API.
type Logging ¶
Logging — интеграция с Клиентским логированием; без Enabled поле не отправляется, пустая группа — по умолчанию.
type OpenSearch ¶ added in v0.6.0
type OpenSearch struct {
// contains filtered or unexported fields
}
OpenSearch — Public API Managed OpenSearch.
func NewOpenSearch ¶ added in v0.6.0
func NewOpenSearch(server string, o Options) (*OpenSearch, error)
func (*OpenSearch) ClusterOperations ¶ added in v0.6.0
func (*OpenSearch) CreateCluster ¶ added in v0.6.0
func (h *OpenSearch) CreateCluster(ctx context.Context, c OpenSearchClusterCreate) ([]byte, error)
func (*OpenSearch) CreateSnapshot ¶ added in v0.6.0
func (*OpenSearch) DeleteCluster ¶ added in v0.6.0
func (*OpenSearch) DeleteSnapshot ¶ added in v0.6.0
func (*OpenSearch) Operations ¶ added in v0.6.0
func (h *OpenSearch) Operations() operation.Getter
func (*OpenSearch) Specs ¶ added in v0.6.0
func (h *OpenSearch) Specs(ctx context.Context, f OpenSearchSpecFilter) ([]byte, error)
Specs — спецификации. С Cluster уходит только cluster_id: вместе с product_type, version или availability_zone_id API отвечает 400 «cluster_id and other parameters can't be specified at the same time» (живой прогон 17.11).
func (*OpenSearch) UpdateCluster ¶ added in v0.6.0
func (h *OpenSearch) UpdateCluster(ctx context.Context, id string, u OpenSearchClusterUpdate) ([]byte, error)
type OpenSearchClusterCreate ¶ added in v0.6.0
type OpenSearchClusterCreate struct {
Project, Name, Description, Version, Spec string
DataNodes, DataGiB int32
MasterNodes, MasterGiB *int32
DataSubnets, MasterSubnets []string
Schedule *OpenSearchSchedule
Restore *OpenSearchRestore
Body []byte
}
func (OpenSearchClusterCreate) Topology ¶ added in v0.6.0
func (c OpenSearchClusterCreate) Topology() (OpenSearchTopology, error)
type OpenSearchClusterUpdate ¶ added in v0.6.0
type OpenSearchClusterUpdate struct {
Spec string
DataNodes, MasterNodes, DataGiB, MasterGiB *int32
DataSubnets, MasterSubnets *[]string
Schedule *OpenSearchSchedule
Body []byte
}
func (OpenSearchClusterUpdate) Topology ¶ added in v0.6.0
func (u OpenSearchClusterUpdate) Topology(current OpenSearchTopology) (OpenSearchTopology, error)
Topology накладывает PATCH на текущие размеры, сохраняя не переданные поля.
type OpenSearchRestore ¶ added in v0.6.0
type OpenSearchSchedule ¶ added in v0.6.0
type OpenSearchSchedule struct {
Cron *string `json:"cron,omitempty"`
Enabled bool `json:"enabled"`
RetentionDays *string `json:"retention_days,omitempty"`
}
OpenSearchSchedule — nil оставляет необязательное поле на усмотрение API.
type OpenSearchSpecFilter ¶ added in v0.6.0
type OpenSearchSpecFilter struct{ Version, Zone, Cluster string }
type OpenSearchTopology ¶ added in v0.6.0
type OpenSearchTopology struct {
Spec string `json:"specification_id"`
DataNodes *int32 `json:"data_nodes"`
MasterNodes *int32 `json:"master_nodes"`
DataGiB *int32 `json:"data_nodes_disk_size_gib"`
MasterGiB *int32 `json:"master_nodes_disk_size_gib"`
Legacy json.RawMessage `json:"subnet_id"`
}
OpenSearchTopology — итоговые размеры после --body; nil означает, что поле не задано.
type Options ¶
type Options struct {
HTTPClient *http.Client
// Auth ставит токен в запрос.
Auth func(ctx context.Context, req *http.Request) error
}
Options — общее для клиентов всех API.
type PostgreSQL ¶ added in v0.5.0
type PostgreSQL struct {
// contains filtered or unexported fields
}
PostgreSQL — Public API Managed PostgreSQL.
func NewPostgreSQL ¶ added in v0.5.0
func NewPostgreSQL(server string, o Options) (*PostgreSQL, error)
func (*PostgreSQL) ClusterLocales ¶ added in v0.5.0
func (*PostgreSQL) ClusterOperations ¶ added in v0.5.0
func (*PostgreSQL) ClusterStorageInfo ¶ added in v0.5.0
func (*PostgreSQL) CreateBackup ¶ added in v0.5.0
func (*PostgreSQL) CreateCluster ¶ added in v0.5.0
func (h *PostgreSQL) CreateCluster(ctx context.Context, c PostgreSQLClusterCreate) ([]byte, error)
func (*PostgreSQL) CreateDatabase ¶ added in v0.5.0
func (h *PostgreSQL) CreateDatabase(ctx context.Context, cluster string, c PostgreSQLDatabaseCreate) ([]byte, error)
func (*PostgreSQL) CreateUser ¶ added in v0.5.0
func (*PostgreSQL) DeleteCluster ¶ added in v0.5.0
func (*PostgreSQL) DeleteDatabase ¶ added in v0.5.0
func (*PostgreSQL) DeleteUser ¶ added in v0.5.0
func (*PostgreSQL) Operations ¶ added in v0.5.0
func (h *PostgreSQL) Operations() operation.Getter
func (*PostgreSQL) ResumeCluster ¶ added in v0.5.0
func (*PostgreSQL) Specs ¶ added in v0.5.0
func (h *PostgreSQL) Specs(ctx context.Context, f PostgreSQLSpecFilter) ([]byte, error)
func (*PostgreSQL) SuspendCluster ¶ added in v0.5.0
func (*PostgreSQL) SwitchoverCluster ¶ added in v0.5.0
func (*PostgreSQL) UpdateCluster ¶ added in v0.5.0
func (h *PostgreSQL) UpdateCluster(ctx context.Context, id string, u PostgreSQLClusterUpdate) ([]byte, error)
func (*PostgreSQL) UpdateUser ¶ added in v0.5.0
func (*PostgreSQL) VersionLocales ¶ added in v0.5.0
type PostgreSQLBackup ¶ added in v0.5.0
type PostgreSQLBackup struct {
RetentionPolicyDays *int32 `json:"retention_policy_days,omitempty"`
Schedule *string `json:"schedule,omitempty"`
}
PostgreSQLBackup — optional backup fields; nil preserves API defaults.
type PostgreSQLClusterCreate ¶ added in v0.5.0
type PostgreSQLClusterCreate struct {
Project, Name, Description, Version, Spec, Database, LCCollate, LCCtype string
Instances, DataGiB, WALGiB int32
Subnets []string
Backup *PostgreSQLBackup
Recovery *PostgreSQLRecovery
Logging Logging
Body []byte
}
func (PostgreSQLClusterCreate) Topology ¶ added in v0.5.0
func (c PostgreSQLClusterCreate) Topology() (PostgreSQLTopology, error)
type PostgreSQLClusterUpdate ¶ added in v0.5.0
type PostgreSQLClusterUpdate struct {
Backup *PostgreSQLBackup
Spec string
Instances *int32
DataGiB, WALGiB int32
Subnets *[]string
Body []byte
}
func (PostgreSQLClusterUpdate) Topology ¶ added in v0.5.0
func (u PostgreSQLClusterUpdate) Topology(current PostgreSQLTopology) (PostgreSQLTopology, error)
Topology применяет PATCH поверх текущей топологии; subnet_ids в PATCH — RepeatedString.
type PostgreSQLDatabaseCreate ¶ added in v0.5.0
type PostgreSQLRecovery ¶ added in v0.5.0
type PostgreSQLRecovery struct {
ClusterID string `json:"cluster_id"`
BackupID string `json:"backup_id,omitempty"`
PITR *time.Time `json:"pitr,omitempty"`
}
PostgreSQLRecovery — restore into a new cluster.
type PostgreSQLSpecFilter ¶ added in v0.5.0
type PostgreSQLSpecFilter struct{ Version, Cluster string }
type PostgreSQLTopology ¶ added in v0.5.0
type PostgreSQLTopology struct {
Spec string `json:"specification_id"`
Version string `json:"version"`
Instances int32 `json:"instances"`
Subnets []string `json:"subnet_ids"`
Legacy json.RawMessage `json:"subnet_id"`
Recovery *PostgreSQLRecovery `json:"recovery_spec"`
}
PostgreSQLTopology — итоговые поля после mergeBody для проверки до запроса.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis — Public API Managed Redis.
func (*Redis) ClusterOperations ¶
ClusterOperations — все операции кластера: {"operations": [...]}.
func (*Redis) CreateCluster ¶
CreateCluster возвращает операцию создания.
func (*Redis) CreateUser ¶
func (r *Redis) CreateUser(ctx context.Context, cluster, name, password string, roles []string) ([]byte, error)
CreateUser возвращает операцию; пустой roles — поле не отправляется.
func (*Redis) DeleteCluster ¶
DeleteCluster возвращает операцию удаления.
func (*Redis) DeleteUser ¶
func (*Redis) Operations ¶
Operations — опрос операций Redis для operation.Waiter.
func (*Redis) UpdateCluster ¶
UpdateCluster возвращает операцию изменения.
func (*Redis) UpdateUser ¶
func (r *Redis) UpdateUser(ctx context.Context, cluster, name string, password *string, roles []string) ([]byte, error)
UpdateUser заменяет пользователя целиком (PUT): nil password — не менять.
type RedisClusterCreate ¶
type RedisClusterCreate struct {
Project, Name, Description, Version, Spec, Type string
Shards, Replicas, StorageGiB int32
Subnets []string
Params map[string]string
Logging Logging
Body []byte
}
RedisClusterCreate — новый кластер. Type — standalone | master-replica. Body — сырой JSON поверх собранного: ключи верхнего уровня заменяют поля.
type RedisClusterUpdate ¶
type RedisClusterUpdate struct {
Spec string
StorageGiB int32
Params map[string]string
Body []byte
}
RedisClusterUpdate — изменение кластера; нулевые поля не отправляются.
type RedisSpecFilter ¶
type RedisSpecFilter struct {
Version, Zone, Cluster string
}
RedisSpecFilter — отбор спецификаций: версия и зона или кластер (для resize).
type SubnetCreate ¶
type SubnetCreate struct {
Project, Name, Zone, CIDR, VPC, Description, Gateway string
DNS []string
Isolated bool
}
SubnetCreate — новая подсеть; пустые необязательные поля не отправляются.
type SubnetFilter ¶
type SubnetFilter struct {
Project, Zone, VPC, Name string
}
SubnetFilter — отбор подсетей; пустые поля не отправляются.
type VPC ¶
type VPC struct {
// contains filtered or unexported fields
}
VPC — Evolution VPC API: сети проекта и их операции.
func (*VPC) Operations ¶
Operations — опрос операций VPC для operation.Waiter.