Documentation
¶
Overview ¶
Package mongodb provides methods and message types of the mongodb v1 API.
Index ¶
- Constants
- type API
- func (s *API) CreateEndpoint(req *CreateEndpointRequest, opts ...scw.RequestOption) (*Endpoint, error)
- func (s *API) CreateInstance(req *CreateInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
- func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
- func (s *API) CreateUser(req *CreateUserRequest, opts ...scw.RequestOption) (*User, error)
- func (s *API) DeleteEndpoint(req *DeleteEndpointRequest, opts ...scw.RequestOption) error
- func (s *API) DeleteInstance(req *DeleteInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
- func (s *API) DeleteSnapshot(req *DeleteSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
- func (s *API) DeleteUser(req *DeleteUserRequest, opts ...scw.RequestOption) error
- func (s *API) FetchLatestEngineVersion() (*Version, error)
- func (s *API) GetInstance(req *GetInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
- func (s *API) GetInstanceCertificate(req *GetInstanceCertificateRequest, opts ...scw.RequestOption) (*scw.File, error)
- func (s *API) GetSnapshot(req *GetSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
- func (s *API) ListDatabases(req *ListDatabasesRequest, opts ...scw.RequestOption) (*ListDatabasesResponse, error)
- func (s *API) ListInstances(req *ListInstancesRequest, opts ...scw.RequestOption) (*ListInstancesResponse, error)
- func (s *API) ListNodeTypes(req *ListNodeTypesRequest, opts ...scw.RequestOption) (*ListNodeTypesResponse, error)
- func (s *API) ListSnapshots(req *ListSnapshotsRequest, opts ...scw.RequestOption) (*ListSnapshotsResponse, error)
- func (s *API) ListUsers(req *ListUsersRequest, opts ...scw.RequestOption) (*ListUsersResponse, error)
- func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error)
- func (s *API) Regions() []scw.Region
- func (s *API) RestoreSnapshot(req *RestoreSnapshotRequest, opts ...scw.RequestOption) (*Instance, error)
- func (s *API) SetUserRole(req *SetUserRoleRequest, opts ...scw.RequestOption) (*User, error)
- func (s *API) UpdateInstance(req *UpdateInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
- func (s *API) UpdateSnapshot(req *UpdateSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
- func (s *API) UpdateUser(req *UpdateUserRequest, opts ...scw.RequestOption) (*User, error)
- func (s *API) UpgradeInstance(req *UpgradeInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
- func (s *API) WaitForInstance(req *WaitForInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
- func (s *API) WaitForSnapshot(req *WaitForSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
- type CreateEndpointRequest
- type CreateInstanceRequest
- type CreateSnapshotRequest
- type CreateUserRequest
- type Database
- type DeleteEndpointRequest
- type DeleteInstanceRequest
- type DeleteSnapshotRequest
- type DeleteUserRequest
- type Endpoint
- type EndpointPrivateNetworkDetails
- type EndpointPublicNetworkDetails
- type EndpointSpec
- type EndpointSpecPrivateNetworkDetails
- type EndpointSpecPublicNetworkDetails
- type GetInstanceCertificateRequest
- type GetInstanceRequest
- type GetSnapshotRequest
- type Instance
- type InstanceSnapshotSchedule
- type InstanceStatus
- type ListDatabasesRequest
- type ListDatabasesRequestOrderBy
- type ListDatabasesResponse
- type ListInstancesRequest
- type ListInstancesRequestOrderBy
- type ListInstancesResponse
- type ListNodeTypesRequest
- type ListNodeTypesResponse
- type ListSnapshotsRequest
- type ListSnapshotsRequestOrderBy
- type ListSnapshotsResponse
- type ListUsersRequest
- type ListUsersRequestOrderBy
- type ListUsersResponse
- type ListVersionsRequest
- type ListVersionsResponse
- type NodeType
- type NodeTypeStock
- type NodeTypeVolumeType
- type RestoreSnapshotRequest
- type SetUserRoleRequest
- type Snapshot
- type SnapshotStatus
- type UpdateInstanceRequest
- type UpdateSnapshotRequest
- type UpdateUserRequest
- type UpgradeInstanceRequest
- type User
- type UserRole
- type UserRoleRole
- type Version
- type Volume
- type VolumeType
- type WaitForInstanceRequest
- type WaitForSnapshotRequest
Constants ¶
const ( InstanceStatusUnknownStatus = InstanceStatus("unknown_status") InstanceStatusReady = InstanceStatus("ready") InstanceStatusProvisioning = InstanceStatus("provisioning") InstanceStatusConfiguring = InstanceStatus("configuring") InstanceStatusDeleting = InstanceStatus("deleting") InstanceStatusError = InstanceStatus("error") InstanceStatusInitializing = InstanceStatus("initializing") InstanceStatusLocked = InstanceStatus("locked") InstanceStatusSnapshotting = InstanceStatus("snapshotting") )
const ( ListDatabasesRequestOrderByNameAsc = ListDatabasesRequestOrderBy("name_asc") ListDatabasesRequestOrderByNameDesc = ListDatabasesRequestOrderBy("name_desc") )
const ( ListInstancesRequestOrderByCreatedAtAsc = ListInstancesRequestOrderBy("created_at_asc") ListInstancesRequestOrderByCreatedAtDesc = ListInstancesRequestOrderBy("created_at_desc") ListInstancesRequestOrderByNameAsc = ListInstancesRequestOrderBy("name_asc") ListInstancesRequestOrderByNameDesc = ListInstancesRequestOrderBy("name_desc") ListInstancesRequestOrderByStatusAsc = ListInstancesRequestOrderBy("status_asc") ListInstancesRequestOrderByStatusDesc = ListInstancesRequestOrderBy("status_desc") )
const ( ListSnapshotsRequestOrderByCreatedAtAsc = ListSnapshotsRequestOrderBy("created_at_asc") ListSnapshotsRequestOrderByCreatedAtDesc = ListSnapshotsRequestOrderBy("created_at_desc") ListSnapshotsRequestOrderByNameAsc = ListSnapshotsRequestOrderBy("name_asc") ListSnapshotsRequestOrderByNameDesc = ListSnapshotsRequestOrderBy("name_desc") ListSnapshotsRequestOrderByExpiresAtAsc = ListSnapshotsRequestOrderBy("expires_at_asc") ListSnapshotsRequestOrderByExpiresAtDesc = ListSnapshotsRequestOrderBy("expires_at_desc") )
const ( ListUsersRequestOrderByNameAsc = ListUsersRequestOrderBy("name_asc") ListUsersRequestOrderByNameDesc = ListUsersRequestOrderBy("name_desc") )
const ( NodeTypeStockUnknownStock = NodeTypeStock("unknown_stock") NodeTypeStockLowStock = NodeTypeStock("low_stock") NodeTypeStockOutOfStock = NodeTypeStock("out_of_stock") NodeTypeStockAvailable = NodeTypeStock("available") )
const ( SnapshotStatusUnknownStatus = SnapshotStatus("unknown_status") SnapshotStatusCreating = SnapshotStatus("creating") SnapshotStatusReady = SnapshotStatus("ready") SnapshotStatusRestoring = SnapshotStatus("restoring") SnapshotStatusDeleting = SnapshotStatus("deleting") SnapshotStatusError = SnapshotStatus("error") SnapshotStatusLocked = SnapshotStatus("locked") )
const ( UserRoleRoleUnknownRole = UserRoleRole("unknown_role") UserRoleRoleRead = UserRoleRole("read") UserRoleRoleReadWrite = UserRoleRole("read_write") UserRoleRoleDbAdmin = UserRoleRole("db_admin") UserRoleRoleSync = UserRoleRole("sync") )
const ( VolumeTypeUnknownType = VolumeType("unknown_type") VolumeTypeSbs5k = VolumeType("sbs_5k") VolumeTypeSbs15k = VolumeType("sbs_15k") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
This API allows you to manage your Managed Databases for MongoDB®.
func (*API) CreateEndpoint ¶
func (s *API) CreateEndpoint(req *CreateEndpointRequest, opts ...scw.RequestOption) (*Endpoint, error)
CreateEndpoint: Create a new endpoint for a MongoDB® Database Instance. You can add `public_network` or `private_network` specifications to the body of the request.
func (*API) CreateInstance ¶
func (s *API) CreateInstance(req *CreateInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
CreateInstance: Create a new MongoDB® Database Instance.
func (*API) CreateSnapshot ¶
func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
CreateSnapshot: Create a new snapshot of a Database Instance. You must define the `name` and `instance_id` parameters in the request.
func (*API) CreateUser ¶
func (s *API) CreateUser(req *CreateUserRequest, opts ...scw.RequestOption) (*User, error)
CreateUser: Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request.
func (*API) DeleteEndpoint ¶
func (s *API) DeleteEndpoint(req *DeleteEndpointRequest, opts ...scw.RequestOption) error
DeleteEndpoint: Delete the endpoint of a Database Instance. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint.
func (*API) DeleteInstance ¶
func (s *API) DeleteInstance(req *DeleteInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
DeleteInstance: Delete a given MongoDB® Database Instance, specified by the `region` and `instance_id` parameters. Deleting a MongoDB® Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost.
func (*API) DeleteSnapshot ¶
func (s *API) DeleteSnapshot(req *DeleteSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
DeleteSnapshot: Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to delete.
func (*API) DeleteUser ¶
func (s *API) DeleteUser(req *DeleteUserRequest, opts ...scw.RequestOption) error
DeleteUser: Delete an existing user on a Database Instance.
func (*API) FetchLatestEngineVersion ¶
func (*API) GetInstance ¶
func (s *API) GetInstance(req *GetInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
GetInstance: Retrieve information about a given MongoDB® Database Instance, specified by the `region` and `instance_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object.
func (*API) GetInstanceCertificate ¶
func (s *API) GetInstanceCertificate(req *GetInstanceCertificateRequest, opts ...scw.RequestOption) (*scw.File, error)
GetInstanceCertificate: Retrieve the certificate of a given Database Instance, specified by the `instance_id` parameter.
func (*API) GetSnapshot ¶
func (s *API) GetSnapshot(req *GetSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
GetSnapshot: Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to retrieve.
func (*API) ListDatabases ¶
func (s *API) ListDatabases(req *ListDatabasesRequest, opts ...scw.RequestOption) (*ListDatabasesResponse, error)
ListDatabases: List all databases of a given Database Instance.
func (*API) ListInstances ¶
func (s *API) ListInstances(req *ListInstancesRequest, opts ...scw.RequestOption) (*ListInstancesResponse, error)
ListInstances: List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter.
func (*API) ListNodeTypes ¶
func (s *API) ListNodeTypes(req *ListNodeTypesRequest, opts ...scw.RequestOption) (*ListNodeTypesResponse, error)
ListNodeTypes: List available node types.
func (*API) ListSnapshots ¶
func (s *API) ListSnapshots(req *ListSnapshotsRequest, opts ...scw.RequestOption) (*ListSnapshotsResponse, error)
ListSnapshots: List snapshots. You can include the `instance_id` or `project_id` in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
func (*API) ListUsers ¶
func (s *API) ListUsers(req *ListUsersRequest, opts ...scw.RequestOption) (*ListUsersResponse, error)
ListUsers: List all users of a given Database Instance.
func (*API) ListVersions ¶
func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error)
ListVersions: List available MongoDB® major versions.
func (*API) RestoreSnapshot ¶
func (s *API) RestoreSnapshot(req *RestoreSnapshotRequest, opts ...scw.RequestOption) (*Instance, error)
RestoreSnapshot: Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to restore, the `instance_name` of the new Database Instance, `node_type` of the new Database Instance and `node_amount` of the new Database Instance.
func (*API) SetUserRole ¶
func (s *API) SetUserRole(req *SetUserRoleRequest, opts ...scw.RequestOption) (*User, error)
SetUserRole: Apply preset roles for a user in a Database Instance.
func (*API) UpdateInstance ¶
func (s *API) UpdateInstance(req *UpdateInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
UpdateInstance: Update the parameters of a MongoDB® Database Instance.
func (*API) UpdateSnapshot ¶
func (s *API) UpdateSnapshot(req *UpdateSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
UpdateSnapshot: Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters.
func (*API) UpdateUser ¶
func (s *API) UpdateUser(req *UpdateUserRequest, opts ...scw.RequestOption) (*User, error)
UpdateUser: Update the parameters of a user on a Database Instance. You can update the `password` parameter, but you cannot change the name of the user.
func (*API) UpgradeInstance ¶
func (s *API) UpgradeInstance(req *UpgradeInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
UpgradeInstance: Upgrade your current Database Instance specifications like volume size.
func (*API) WaitForInstance ¶
func (s *API) WaitForInstance(req *WaitForInstanceRequest, opts ...scw.RequestOption) (*Instance, error)
WaitForInstance waits for the instance to be in a "terminal state" before returning. This function can be used to wait for an instance to be ready or in another final state.
func (*API) WaitForSnapshot ¶
func (s *API) WaitForSnapshot(req *WaitForSnapshotRequest, opts ...scw.RequestOption) (*Snapshot, error)
WaitForSnapshot waits for the snapshot to reach a "terminal state" before returning.
type CreateEndpointRequest ¶
type CreateEndpointRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance. InstanceID string `json:"instance_id"` // Endpoint: endpointSpec used to expose your Database Instance. Endpoint *EndpointSpec `json:"endpoint"` }
CreateEndpointRequest: create endpoint request.
type CreateInstanceRequest ¶
type CreateInstanceRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // ProjectID: the Project ID on which the Database Instance will be created. ProjectID string `json:"project_id"` // Name: name of the Database Instance. Name string `json:"name"` // Version: major version of the MongoDB® engine. Version string `json:"version"` // Tags: tags to apply to the Database Instance. Tags []string `json:"tags"` // NodeAmount: number of node to use for the Database Instance. NodeAmount uint32 `json:"node_amount"` // NodeType: type of node to use for the Database Instance. NodeType string `json:"node_type"` // UserName: username created when the Database Instance is created. UserName string `json:"user_name"` // Password: password of the initial user. Password string `json:"password"` // Volume: instance volume information. Volume *Volume `json:"volume,omitempty"` // Endpoints: one or multiple EndpointSpec used to expose your Database Instance. Endpoints []*EndpointSpec `json:"endpoints"` }
CreateInstanceRequest: create instance request.
type CreateSnapshotRequest ¶
type CreateSnapshotRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance to snapshot. InstanceID string `json:"instance_id"` // Name: name of the snapshot. Name string `json:"name"` // ExpiresAt: expiration date of the snapshot (must follow the ISO 8601 format). ExpiresAt *time.Time `json:"expires_at,omitempty"` }
CreateSnapshotRequest: create snapshot request.
type CreateUserRequest ¶
type CreateUserRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance the user belongs to. InstanceID string `json:"-"` // Name: name of the database user. Name string `json:"name"` // Password: password of the database user. Password string `json:"password"` }
CreateUserRequest: create user request.
type DeleteEndpointRequest ¶
type DeleteEndpointRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // EndpointID: UUID of the Endpoint to delete. EndpointID string `json:"-"` }
DeleteEndpointRequest: delete endpoint request.
type DeleteInstanceRequest ¶
type DeleteInstanceRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance to delete. InstanceID string `json:"-"` }
DeleteInstanceRequest: delete instance request.
type DeleteSnapshotRequest ¶
type DeleteSnapshotRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // SnapshotID: UUID of the snapshot. SnapshotID string `json:"-"` }
DeleteSnapshotRequest: delete snapshot request.
type DeleteUserRequest ¶
type DeleteUserRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance the user belongs to. InstanceID string `json:"-"` // Name: name of the database user. Name string `json:"-"` }
DeleteUserRequest: delete user request.
type Endpoint ¶
type Endpoint struct { // ID: UUID of the endpoint. ID string `json:"id"` // DNSRecord: list of DNS records of the endpoint. DNSRecord string `json:"dns_record"` // Port: TCP port of the endpoint. Port uint32 `json:"port"` // PrivateNetwork: private Network endpoint details. // Precisely one of PrivateNetwork, PublicNetwork must be set. PrivateNetwork *EndpointPrivateNetworkDetails `json:"private_network,omitempty"` // PublicNetwork: public Network endpoint details. // Precisely one of PrivateNetwork, PublicNetwork must be set. PublicNetwork *EndpointPublicNetworkDetails `json:"public_network,omitempty"` }
Endpoint: endpoint.
type EndpointPrivateNetworkDetails ¶
type EndpointPrivateNetworkDetails struct { // PrivateNetworkID: UUID of the Private Network. PrivateNetworkID string `json:"private_network_id"` }
EndpointPrivateNetworkDetails: Private Network details.
type EndpointPublicNetworkDetails ¶
type EndpointPublicNetworkDetails struct{}
EndpointPublicNetworkDetails: Public Access details.
type EndpointSpec ¶
type EndpointSpec struct { // Precisely one of PublicNetwork, PrivateNetwork must be set. PublicNetwork *EndpointSpecPublicNetworkDetails `json:"public_network,omitempty"` // Precisely one of PublicNetwork, PrivateNetwork must be set. PrivateNetwork *EndpointSpecPrivateNetworkDetails `json:"private_network,omitempty"` }
EndpointSpec: endpoint spec.
type EndpointSpecPrivateNetworkDetails ¶
type EndpointSpecPrivateNetworkDetails struct { // PrivateNetworkID: UUID of the Private Network. PrivateNetworkID string `json:"private_network_id"` }
EndpointSpecPrivateNetworkDetails: endpoint spec private network details.
type EndpointSpecPublicNetworkDetails ¶
type EndpointSpecPublicNetworkDetails struct{}
EndpointSpecPublicNetworkDetails: endpoint spec public network details.
type GetInstanceCertificateRequest ¶
type GetInstanceCertificateRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance. InstanceID string `json:"-"` }
GetInstanceCertificateRequest: get instance certificate request.
type GetInstanceRequest ¶
type GetInstanceRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance. InstanceID string `json:"-"` }
GetInstanceRequest: get instance request.
type GetSnapshotRequest ¶
type GetSnapshotRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // SnapshotID: UUID of the snapshot. SnapshotID string `json:"-"` }
GetSnapshotRequest: get snapshot request.
type Instance ¶
type Instance struct { // ID: UUID of the Database Instance. ID string `json:"id"` // Name: name of the Database Instance. Name string `json:"name"` // ProjectID: project ID the Database Instance belongs to. ProjectID string `json:"project_id"` // OrganizationID: organization ID the Database Instance belongs to. OrganizationID string `json:"organization_id"` // Status: status of the Database Instance. // Default value: unknown_status Status InstanceStatus `json:"status"` // Version: mongoDB® major engine version of the Database Instance. Version string `json:"version"` // Tags: list of tags applied to the Database Instance. Tags []string `json:"tags"` // NodeAmount: number of node in the Database Instance. NodeAmount uint32 `json:"node_amount"` // NodeType: node type of the Database Instance. NodeType string `json:"node_type"` // Volume: volumes of the Database Instance. Volume *Volume `json:"volume"` // Endpoints: list of Database Instance endpoints. Endpoints []*Endpoint `json:"endpoints"` // CreatedAt: creation date (must follow the ISO 8601 format). CreatedAt *time.Time `json:"created_at"` // Region: region the Database Instance is in. Region scw.Region `json:"region"` // SnapshotSchedule: snapshot schedule configuration of the Database Instance. SnapshotSchedule *InstanceSnapshotSchedule `json:"snapshot_schedule"` }
Instance: instance.
type InstanceSnapshotSchedule ¶
type InstanceSnapshotSchedule struct { FrequencyHours int32 `json:"frequency_hours"` RetentionDays int32 `json:"retention_days"` Enabled bool `json:"enabled"` NextUpdate *time.Time `json:"next_update"` LastRun *time.Time `json:"last_run"` }
InstanceSnapshotSchedule: instance snapshot schedule.
type InstanceStatus ¶
type InstanceStatus string
func (InstanceStatus) MarshalJSON ¶
func (enum InstanceStatus) MarshalJSON() ([]byte, error)
func (InstanceStatus) String ¶
func (enum InstanceStatus) String() string
func (*InstanceStatus) UnmarshalJSON ¶
func (enum *InstanceStatus) UnmarshalJSON(data []byte) error
func (InstanceStatus) Values ¶
func (enum InstanceStatus) Values() []InstanceStatus
type ListDatabasesRequest ¶
type ListDatabasesRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance. InstanceID string `json:"-"` // OrderBy: criteria to use when requesting user listing. // Default value: name_asc OrderBy ListDatabasesRequestOrderBy `json:"-"` Page *int32 `json:"-"` PageSize *uint32 `json:"-"` }
ListDatabasesRequest: list databases request.
type ListDatabasesRequestOrderBy ¶
type ListDatabasesRequestOrderBy string
func (ListDatabasesRequestOrderBy) MarshalJSON ¶
func (enum ListDatabasesRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListDatabasesRequestOrderBy) String ¶
func (enum ListDatabasesRequestOrderBy) String() string
func (*ListDatabasesRequestOrderBy) UnmarshalJSON ¶
func (enum *ListDatabasesRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListDatabasesRequestOrderBy) Values ¶
func (enum ListDatabasesRequestOrderBy) Values() []ListDatabasesRequestOrderBy
type ListDatabasesResponse ¶
type ListDatabasesResponse struct { // Databases: list of the databases. Databases []*Database `json:"databases"` // TotalCount: total count of databases present on a Database Instance. TotalCount uint64 `json:"total_count"` }
ListDatabasesResponse: list databases response.
func (*ListDatabasesResponse) UnsafeAppend ¶
func (r *ListDatabasesResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListDatabasesResponse) UnsafeGetTotalCount ¶
func (r *ListDatabasesResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListInstancesRequest ¶
type ListInstancesRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // Tags: list Database Instances that have a given tag. Tags []string `json:"-"` // Name: lists Database Instances that match a name pattern. Name *string `json:"-"` // OrderBy: criteria to use when ordering Database Instance listings. // Default value: created_at_asc OrderBy ListInstancesRequestOrderBy `json:"-"` // OrganizationID: organization ID of the Database Instance. OrganizationID *string `json:"-"` // ProjectID: project ID to list the instances of. ProjectID *string `json:"-"` Page *int32 `json:"-"` PageSize *uint32 `json:"-"` }
ListInstancesRequest: list instances request.
type ListInstancesRequestOrderBy ¶
type ListInstancesRequestOrderBy string
func (ListInstancesRequestOrderBy) MarshalJSON ¶
func (enum ListInstancesRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListInstancesRequestOrderBy) String ¶
func (enum ListInstancesRequestOrderBy) String() string
func (*ListInstancesRequestOrderBy) UnmarshalJSON ¶
func (enum *ListInstancesRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListInstancesRequestOrderBy) Values ¶
func (enum ListInstancesRequestOrderBy) Values() []ListInstancesRequestOrderBy
type ListInstancesResponse ¶
type ListInstancesResponse struct { // Instances: list of all Database Instances available in an Organization or Project. Instances []*Instance `json:"instances"` // TotalCount: total count of Database Instances available in an Organization or Project. TotalCount uint64 `json:"total_count"` }
ListInstancesResponse: list instances response.
func (*ListInstancesResponse) UnsafeAppend ¶
func (r *ListInstancesResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListInstancesResponse) UnsafeGetTotalCount ¶
func (r *ListInstancesResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListNodeTypesRequest ¶
type ListNodeTypesRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // IncludeDisabled: defines whether or not to include disabled types. IncludeDisabled *bool `json:"-"` Page *int32 `json:"-"` PageSize *uint32 `json:"-"` }
ListNodeTypesRequest: list node types request.
type ListNodeTypesResponse ¶
type ListNodeTypesResponse struct { // NodeTypes: types of the node. NodeTypes []*NodeType `json:"node_types"` // TotalCount: total count of node-types available. TotalCount uint64 `json:"total_count"` }
ListNodeTypesResponse: list node types response.
func (*ListNodeTypesResponse) UnsafeAppend ¶
func (r *ListNodeTypesResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListNodeTypesResponse) UnsafeGetTotalCount ¶
func (r *ListNodeTypesResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListSnapshotsRequest ¶
type ListSnapshotsRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: instance ID the snapshots belongs to. InstanceID *string `json:"-"` // Name: lists database snapshots that match a name pattern. Name *string `json:"-"` // OrderBy: criteria to use when ordering snapshot listings. // Default value: created_at_asc OrderBy ListSnapshotsRequestOrderBy `json:"-"` // OrganizationID: organization ID the snapshots belongs to. OrganizationID *string `json:"-"` // ProjectID: project ID to list the snapshots of. ProjectID *string `json:"-"` Page *int32 `json:"-"` PageSize *uint32 `json:"-"` }
ListSnapshotsRequest: list snapshots request.
type ListSnapshotsRequestOrderBy ¶
type ListSnapshotsRequestOrderBy string
func (ListSnapshotsRequestOrderBy) MarshalJSON ¶
func (enum ListSnapshotsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListSnapshotsRequestOrderBy) String ¶
func (enum ListSnapshotsRequestOrderBy) String() string
func (*ListSnapshotsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListSnapshotsRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListSnapshotsRequestOrderBy) Values ¶
func (enum ListSnapshotsRequestOrderBy) Values() []ListSnapshotsRequestOrderBy
type ListSnapshotsResponse ¶
type ListSnapshotsResponse struct { // Snapshots: list of all database snapshots available in an Organization or Project. Snapshots []*Snapshot `json:"snapshots"` // TotalCount: total count of database snapshots available in a Organization or Project. TotalCount uint64 `json:"total_count"` }
ListSnapshotsResponse: list snapshots response.
func (*ListSnapshotsResponse) UnsafeAppend ¶
func (r *ListSnapshotsResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListSnapshotsResponse) UnsafeGetTotalCount ¶
func (r *ListSnapshotsResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListUsersRequest ¶
type ListUsersRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance. InstanceID string `json:"-"` // Name: name of the user. Name *string `json:"-"` // OrderBy: criteria to use when requesting user listing. // Default value: name_asc OrderBy ListUsersRequestOrderBy `json:"-"` Page *int32 `json:"-"` PageSize *uint32 `json:"-"` }
ListUsersRequest: list users request.
type ListUsersRequestOrderBy ¶
type ListUsersRequestOrderBy string
func (ListUsersRequestOrderBy) MarshalJSON ¶
func (enum ListUsersRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListUsersRequestOrderBy) String ¶
func (enum ListUsersRequestOrderBy) String() string
func (*ListUsersRequestOrderBy) UnmarshalJSON ¶
func (enum *ListUsersRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListUsersRequestOrderBy) Values ¶
func (enum ListUsersRequestOrderBy) Values() []ListUsersRequestOrderBy
type ListUsersResponse ¶
type ListUsersResponse struct { // Users: list of users in a Database Instance. Users []*User `json:"users"` // TotalCount: total count of users present on a Database Instance. TotalCount uint64 `json:"total_count"` }
ListUsersResponse: list users response.
func (*ListUsersResponse) UnsafeAppend ¶
func (r *ListUsersResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListUsersResponse) UnsafeGetTotalCount ¶
func (r *ListUsersResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListVersionsRequest ¶
type ListVersionsRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` Version *string `json:"-"` Page *int32 `json:"-"` PageSize *uint32 `json:"-"` }
ListVersionsRequest: list versions request.
type ListVersionsResponse ¶
type ListVersionsResponse struct { // Versions: available MongoDB® major engine version. Versions []*Version `json:"versions"` // TotalCount: total count of MongoDB® major engine version available. TotalCount uint64 `json:"total_count"` }
ListVersionsResponse: list versions response.
func (*ListVersionsResponse) UnsafeAppend ¶
func (r *ListVersionsResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListVersionsResponse) UnsafeGetTotalCount ¶
func (r *ListVersionsResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type NodeType ¶
type NodeType struct { // Name: node type name identifier. Name string `json:"name"` // StockStatus: current stock status for the node type. // Default value: unknown_stock StockStatus NodeTypeStock `json:"stock_status"` // Description: current specs of the offer. Description string `json:"description"` // Vcpus: number of virtual CPUs. Vcpus uint32 `json:"vcpus"` // MemoryBytes: quantity of RAM. MemoryBytes scw.Size `json:"memory_bytes"` // AvailableVolumeTypes: available storage options for the node type. AvailableVolumeTypes []*NodeTypeVolumeType `json:"available_volume_types"` // Disabled: the node type is currently disabled. Disabled bool `json:"disabled"` // Beta: the node type is currently in beta. Beta bool `json:"beta"` // InstanceRange: instance range associated with the node type offer. InstanceRange string `json:"instance_range"` }
NodeType: node type.
type NodeTypeStock ¶
type NodeTypeStock string
func (NodeTypeStock) MarshalJSON ¶
func (enum NodeTypeStock) MarshalJSON() ([]byte, error)
func (NodeTypeStock) String ¶
func (enum NodeTypeStock) String() string
func (*NodeTypeStock) UnmarshalJSON ¶
func (enum *NodeTypeStock) UnmarshalJSON(data []byte) error
func (NodeTypeStock) Values ¶
func (enum NodeTypeStock) Values() []NodeTypeStock
type NodeTypeVolumeType ¶
type NodeTypeVolumeType struct { // Type: volume Type. // Default value: unknown_type Type VolumeType `json:"type"` // Description: the description of the volume. Description string `json:"description"` // MinSizeBytes: minimum size required for the volume. MinSizeBytes scw.Size `json:"min_size_bytes"` // MaxSizeBytes: maximum size required for the volume. MaxSizeBytes scw.Size `json:"max_size_bytes"` // ChunkSizeBytes: minimum increment level for a Block Storage volume size. ChunkSizeBytes scw.Size `json:"chunk_size_bytes"` }
NodeTypeVolumeType: node type volume type.
type RestoreSnapshotRequest ¶
type RestoreSnapshotRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // SnapshotID: UUID of the snapshot. SnapshotID string `json:"-"` // InstanceName: name of the new Database Instance. InstanceName string `json:"instance_name"` // NodeType: node type to use for the new Database Instance. NodeType string `json:"node_type"` // NodeAmount: number of nodes to use for the new Database Instance. NodeAmount uint32 `json:"node_amount"` // VolumeType: instance volume type. // Default value: unknown_type VolumeType VolumeType `json:"volume_type"` }
RestoreSnapshotRequest: restore snapshot request.
type SetUserRoleRequest ¶
type SetUserRoleRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance the user belongs to. InstanceID string `json:"-"` // UserName: name of the database user. UserName string `json:"user_name"` // Roles: list of roles assigned to the user, along with the corresponding database where each role is granted. Roles []*UserRole `json:"roles"` }
SetUserRoleRequest: set user role request.
type Snapshot ¶
type Snapshot struct { // ID: UUID of the snapshot. ID string `json:"id"` // InstanceID: UUID of the Database Instance. InstanceID *string `json:"instance_id"` // Name: name of the snapshot. Name string `json:"name"` // Status: status of the snapshot. // Default value: unknown_status Status SnapshotStatus `json:"status"` // SizeBytes: size of the snapshot. SizeBytes scw.Size `json:"size_bytes"` // ExpiresAt: expiration date (must follow the ISO 8601 format). ExpiresAt *time.Time `json:"expires_at"` // CreatedAt: creation date (must follow the ISO 8601 format). CreatedAt *time.Time `json:"created_at"` // UpdatedAt: updated date (must follow the ISO 8601 format). UpdatedAt *time.Time `json:"updated_at"` // InstanceName: name of the Database Instance of the snapshot. InstanceName string `json:"instance_name"` // NodeType: source node type. NodeType string `json:"node_type"` // VolumeType: type of volume where data is stored - sbs_5k or sbs_15k. // Default value: unknown_type VolumeType VolumeType `json:"volume_type"` // Region: region of the snapshot. Region scw.Region `json:"region"` }
Snapshot: snapshot.
type SnapshotStatus ¶
type SnapshotStatus string
func (SnapshotStatus) MarshalJSON ¶
func (enum SnapshotStatus) MarshalJSON() ([]byte, error)
func (SnapshotStatus) String ¶
func (enum SnapshotStatus) String() string
func (*SnapshotStatus) UnmarshalJSON ¶
func (enum *SnapshotStatus) UnmarshalJSON(data []byte) error
func (SnapshotStatus) Values ¶
func (enum SnapshotStatus) Values() []SnapshotStatus
type UpdateInstanceRequest ¶
type UpdateInstanceRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance to update. InstanceID string `json:"-"` // Name: name of the Database Instance. Name *string `json:"name,omitempty"` // Tags: tags of a Database Instance. Tags *[]string `json:"tags,omitempty"` // SnapshotScheduleFrequencyHours: in hours. SnapshotScheduleFrequencyHours *uint32 `json:"snapshot_schedule_frequency_hours,omitempty"` // SnapshotScheduleRetentionDays: in days. SnapshotScheduleRetentionDays *uint32 `json:"snapshot_schedule_retention_days,omitempty"` // IsSnapshotScheduleEnabled: defines whether or not the snapshot schedule is enabled. IsSnapshotScheduleEnabled *bool `json:"is_snapshot_schedule_enabled,omitempty"` }
UpdateInstanceRequest: update instance request.
type UpdateSnapshotRequest ¶
type UpdateSnapshotRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // SnapshotID: UUID of the Snapshot. SnapshotID string `json:"-"` // Name: name of the snapshot. Name *string `json:"name,omitempty"` // ExpiresAt: expiration date of the snapshot (must follow the ISO 8601 format). ExpiresAt *time.Time `json:"expires_at,omitempty"` }
UpdateSnapshotRequest: update snapshot request.
type UpdateUserRequest ¶
type UpdateUserRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance the user belongs to. InstanceID string `json:"-"` // Name: name of the database user. Name string `json:"-"` // Password: password of the database user. Password *string `json:"password,omitempty"` }
UpdateUserRequest: update user request.
type UpgradeInstanceRequest ¶
type UpgradeInstanceRequest struct { // Region: region to target. If none is passed will use default region from the config. Region scw.Region `json:"-"` // InstanceID: UUID of the Database Instance you want to upgrade. InstanceID string `json:"-"` // VolumeSizeBytes: increase your Block Storage volume size. // Precisely one of VolumeSizeBytes must be set. VolumeSizeBytes *scw.Size `json:"volume_size_bytes,omitempty"` }
UpgradeInstanceRequest: upgrade instance request.
type User ¶
type User struct { // Name: name of the user (Length must be between 1 and 63 characters. First character must be an alphabet character (a-zA-Z). Only a-zA-Z0-9_$- characters are accepted). Name string `json:"name"` // Roles: list of roles assigned to the user, along with the corresponding database where each role is granted. Roles []*UserRole `json:"roles"` }
User: user.
type UserRole ¶
type UserRole struct { // Role: name of the preset role. // Default value: unknown_role Role UserRoleRole `json:"role"` // DatabaseName: name of the database on which the preset role will be used. // Precisely one of DatabaseName, AnyDatabase must be set. DatabaseName *string `json:"database_name,omitempty"` // AnyDatabase: flag to enable the preset role in all databases. // Precisely one of DatabaseName, AnyDatabase must be set. AnyDatabase *bool `json:"any_database,omitempty"` }
UserRole: user role.
type UserRoleRole ¶
type UserRoleRole string
func (UserRoleRole) MarshalJSON ¶
func (enum UserRoleRole) MarshalJSON() ([]byte, error)
func (UserRoleRole) String ¶
func (enum UserRoleRole) String() string
func (*UserRoleRole) UnmarshalJSON ¶
func (enum *UserRoleRole) UnmarshalJSON(data []byte) error
func (UserRoleRole) Values ¶
func (enum UserRoleRole) Values() []UserRoleRole
type Version ¶
type Version struct { // Version: mongoDB® major engine version. Version string `json:"version"` // EndOfLifeAt: date of End of Life. EndOfLifeAt *time.Time `json:"end_of_life_at"` }
Version: version.
type Volume ¶
type Volume struct { // Type: type of volume where data is stored. // Default value: unknown_type Type VolumeType `json:"type"` // SizeBytes: volume size. SizeBytes scw.Size `json:"size_bytes"` }
Volume: volume.
type VolumeType ¶
type VolumeType string
func (VolumeType) MarshalJSON ¶
func (enum VolumeType) MarshalJSON() ([]byte, error)
func (VolumeType) String ¶
func (enum VolumeType) String() string
func (*VolumeType) UnmarshalJSON ¶
func (enum *VolumeType) UnmarshalJSON(data []byte) error
func (VolumeType) Values ¶
func (enum VolumeType) Values() []VolumeType