mnq

package
v1.0.0-beta.20 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package mnq provides methods and message types of the mnq v1alpha1 API.

Index

Constants

View Source
const (
	// Order by id (ascending alphabetical order)
	ListCredentialsRequestOrderByIDAsc = ListCredentialsRequestOrderBy("id_asc")
	// Order by id (descending alphabetical order)
	ListCredentialsRequestOrderByIDDesc = ListCredentialsRequestOrderBy("id_desc")
	// Order by name (ascending alphabetical order)
	ListCredentialsRequestOrderByNameAsc = ListCredentialsRequestOrderBy("name_asc")
	// Order by name (descending alphabetical order)
	ListCredentialsRequestOrderByNameDesc = ListCredentialsRequestOrderBy("name_desc")
)
View Source
const (
	// Order by creation date (ascending chronological order)
	ListNamespacesRequestOrderByCreatedAtAsc = ListNamespacesRequestOrderBy("created_at_asc")
	// Order by creation date (descending chronological order)
	ListNamespacesRequestOrderByCreatedAtDesc = ListNamespacesRequestOrderBy("created_at_desc")
	// Order by last update date (ascending chronological order)
	ListNamespacesRequestOrderByUpdatedAtAsc = ListNamespacesRequestOrderBy("updated_at_asc")
	// Order by last update date (descending chronological order)
	ListNamespacesRequestOrderByUpdatedAtDesc = ListNamespacesRequestOrderBy("updated_at_desc")
	// Order by id (ascending alphabetical order)
	ListNamespacesRequestOrderByIDAsc = ListNamespacesRequestOrderBy("id_asc")
	// Order by id (descending alphabetical order)
	ListNamespacesRequestOrderByIDDesc = ListNamespacesRequestOrderBy("id_desc")
	// Order by name (ascending alphabetical order)
	ListNamespacesRequestOrderByNameAsc = ListNamespacesRequestOrderBy("name_asc")
	// Order by name (descending alphabetical order)
	ListNamespacesRequestOrderByNameDesc = ListNamespacesRequestOrderBy("name_desc")
	// Order by project_id (ascending alphabetical order)
	ListNamespacesRequestOrderByProjectIDAsc = ListNamespacesRequestOrderBy("project_id_asc")
	// Order by project_id (descending alphabetical order)
	ListNamespacesRequestOrderByProjectIDDesc = ListNamespacesRequestOrderBy("project_id_desc")
)
View Source
const (
	// Unknown protocol
	NamespaceProtocolUnknown = NamespaceProtocol("unknown")
	// NATS protocol
	NamespaceProtocolNats = NamespaceProtocol("nats")
	// SQS / SNS protocol
	NamespaceProtocolSqsSns = NamespaceProtocol("sqs_sns")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API: this API allows you to manage Scaleway Messaging and Queueing brokers. Messaging and Queuing API.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateCredential

func (s *API) CreateCredential(req *CreateCredentialRequest, opts ...scw.RequestOption) (*Credential, error)

CreateCredential: create credentials. Create a set of credentials for a Messaging and Queuing namespace, specified by its namespace ID. If creating credentials for a NATS namespace, the `permissions` object must not be included in the request. If creating credentials for an SQS/SNS namespace, the `permissions` object is required, with all three of its child attributes.

func (*API) CreateNamespace

func (s *API) CreateNamespace(req *CreateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

CreateNamespace: create a namespace. Create a Messaging and Queuing namespace, set to the desired protocol.

func (*API) DeleteCredential

func (s *API) DeleteCredential(req *DeleteCredentialRequest, opts ...scw.RequestOption) error

DeleteCredential: delete credentials. Delete a set of credentials, specified by their credential ID. Deleting credentials is irreversible and cannot be undone. The credentials can no longer be used to access the namespace.

func (*API) DeleteNamespace

func (s *API) DeleteNamespace(req *DeleteNamespaceRequest, opts ...scw.RequestOption) error

DeleteNamespace: delete a namespace. Delete a Messaging and Queuing namespace, specified by its namespace ID. Note that deleting a namespace is irreversible, and any URLs, credentials and queued messages belonging to this namespace will also be deleted.

func (*API) GetCredential

func (s *API) GetCredential(req *GetCredentialRequest, opts ...scw.RequestOption) (*Credential, error)

GetCredential: get credentials. Retrieve an existing set of credentials, identified by the `credential_id`. The credentials themselves, as well as their metadata (protocol, namespace ID etc), are returned in the response.

func (*API) GetNamespace

func (s *API) GetNamespace(req *GetNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

GetNamespace: get a namespace. Retrieve information about an existing Messaging and Queuing namespace, identified by its namespace ID. Its full details, including name, endpoint and protocol, are returned in the response.

func (*API) ListCredentials

func (s *API) ListCredentials(req *ListCredentialsRequest, opts ...scw.RequestOption) (*ListCredentialsResponse, error)

ListCredentials: list credentials. List existing credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves (for this, use **Get Credentials**).

func (*API) ListNamespaces

func (s *API) ListNamespaces(req *ListNamespacesRequest, opts ...scw.RequestOption) (*ListNamespacesResponse, error)

ListNamespaces: list namespaces. List all Messaging and Queuing namespaces in the specified region, for a Scaleway Organization or Project. By default, the namespaces returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.

func (*API) Regions

func (s *API) Regions() []scw.Region

Regions list localities the api is available in

func (*API) UpdateCredential

func (s *API) UpdateCredential(req *UpdateCredentialRequest, opts ...scw.RequestOption) (*Credential, error)

UpdateCredential: update credentials. Update a set of credentials. You can update the credentials' name, or (in the case of SQS/SNS credentials only) their permissions. To update the name of NATS credentials, do not include the `permissions` object in your request.

func (*API) UpdateNamespace

func (s *API) UpdateNamespace(req *UpdateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)

UpdateNamespace: update the name of a namespace. Update the name of a Messaging and Queuing namespace, specified by its namespace ID.

type CreateCredentialRequest

type CreateCredentialRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// NamespaceID: namespace containing the credentials.
	NamespaceID string `json:"namespace_id"`
	// Name: name of the credentials.
	Name string `json:"name"`
	// Permissions: permissions associated with these credentials.
	Permissions *Permissions `json:"permissions"`
}

type CreateNamespaceRequest

type CreateNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// Name: namespace name.
	Name string `json:"name"`
	// Protocol: namespace protocol. You must specify a valid protocol (and not `unknown`) to avoid an error.
	// Default value: unknown
	Protocol NamespaceProtocol `json:"protocol"`
	// ProjectID: project containing the Namespace.
	ProjectID string `json:"project_id"`
}

type Credential

type Credential struct {
	// ID: ID of the credentials.
	ID string `json:"id"`
	// Name: name of the credentials.
	Name string `json:"name"`
	// NamespaceID: namespace containing the credentials.
	NamespaceID string `json:"namespace_id"`
	// Protocol: protocol associated with the credentials.
	// Default value: unknown
	Protocol NamespaceProtocol `json:"protocol"`
	// NatsCredentials: object containing the credentials, if the credentials are for a NATS namespace.
	// Precisely one of NatsCredentials, SqsSnsCredentials must be set.
	NatsCredentials *CredentialNATSCredsFile `json:"nats_credentials,omitempty"`
	// SqsSnsCredentials: object containing the credentials and their metadata, if the credentials are for an SQS/SNS namespace.
	// Precisely one of NatsCredentials, SqsSnsCredentials must be set.
	SqsSnsCredentials *CredentialSQSSNSCreds `json:"sqs_sns_credentials,omitempty"`
}

Credential: credential.

type CredentialNATSCredsFile

type CredentialNATSCredsFile struct {
	// Content: raw content of the NATS credentials file.
	Content string `json:"content"`
}

CredentialNATSCredsFile: credential.nats creds file.

type CredentialSQSSNSCreds

type CredentialSQSSNSCreds struct {
	// AccessKey: access key ID.
	AccessKey string `json:"access_key"`
	// SecretKey: secret key ID.
	SecretKey *string `json:"secret_key"`
	// Permissions: permissions associated with these credentials.
	Permissions *Permissions `json:"permissions"`
}

CredentialSQSSNSCreds: credential.sqssns creds.

type CredentialSummary

type CredentialSummary struct {
	// ID: ID of the credentials.
	ID string `json:"id"`
	// Name: name of the credentials.
	Name string `json:"name"`
	// NamespaceID: namespace containing the credentials.
	NamespaceID string `json:"namespace_id"`
	// Protocol: protocol associated with the credentials.
	// Default value: unknown
	Protocol NamespaceProtocol `json:"protocol"`
	// SqsSnsCredentials: object containing the credentials and their metadata, if the credentials are for an SQS/SNS namespace.
	// Precisely one of SqsSnsCredentials must be set.
	SqsSnsCredentials *CredentialSummarySQSSNSCreds `json:"sqs_sns_credentials,omitempty"`
}

CredentialSummary: credential summary.

type CredentialSummarySQSSNSCreds

type CredentialSummarySQSSNSCreds struct {
	// AccessKey: access key ID.
	AccessKey string `json:"access_key"`
	// Permissions: permissions associated with these credentials.
	Permissions *Permissions `json:"permissions"`
}

CredentialSummarySQSSNSCreds: credential summary.sqssns creds.

type DeleteCredentialRequest

type DeleteCredentialRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// CredentialID: ID of the credentials to delete.
	CredentialID string `json:"-"`
}

type DeleteNamespaceRequest

type DeleteNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// NamespaceID: ID of the namespace to delete.
	NamespaceID string `json:"-"`
}

type GetCredentialRequest

type GetCredentialRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// CredentialID: ID of the credentials to get.
	CredentialID string `json:"-"`
}

type GetNamespaceRequest

type GetNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// NamespaceID: ID of the Namespace to get.
	NamespaceID string `json:"-"`
}

type ListCredentialsRequest

type ListCredentialsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// NamespaceID: namespace containing the credentials.
	NamespaceID *string `json:"-"`
	// Page: page number to return.
	Page *int32 `json:"-"`
	// PageSize: maximum number of credentials to return per page.
	PageSize *uint32 `json:"-"`
	// OrderBy: order in which to return results.
	// Default value: id_asc
	OrderBy ListCredentialsRequestOrderBy `json:"-"`
}

type ListCredentialsRequestOrderBy

type ListCredentialsRequestOrderBy string

func (ListCredentialsRequestOrderBy) MarshalJSON

func (enum ListCredentialsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListCredentialsRequestOrderBy) String

func (enum ListCredentialsRequestOrderBy) String() string

func (*ListCredentialsRequestOrderBy) UnmarshalJSON

func (enum *ListCredentialsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListCredentialsResponse

type ListCredentialsResponse struct {
	// TotalCount: total count of existing credentials (matching any filters specified).
	TotalCount uint32 `json:"total_count"`
	// Credentials: credentials on this page.
	Credentials []*CredentialSummary `json:"credentials"`
}

ListCredentialsResponse: list credentials response.

func (*ListCredentialsResponse) UnsafeAppend

func (r *ListCredentialsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListCredentialsResponse) UnsafeGetTotalCount

func (r *ListCredentialsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListNamespacesRequest

type ListNamespacesRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// OrganizationID: include only namespaces in this Organization.
	OrganizationID *string `json:"-"`
	// ProjectID: include only namespaces in this Project.
	ProjectID *string `json:"-"`
	// Page: page number to return.
	Page *int32 `json:"-"`
	// PageSize: maximum number of namespaces to return per page.
	PageSize *uint32 `json:"-"`
	// OrderBy: order in which to return results.
	// Default value: created_at_asc
	OrderBy ListNamespacesRequestOrderBy `json:"-"`
}

type ListNamespacesRequestOrderBy

type ListNamespacesRequestOrderBy string

func (ListNamespacesRequestOrderBy) MarshalJSON

func (enum ListNamespacesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListNamespacesRequestOrderBy) String

func (enum ListNamespacesRequestOrderBy) String() string

func (*ListNamespacesRequestOrderBy) UnmarshalJSON

func (enum *ListNamespacesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListNamespacesResponse

type ListNamespacesResponse struct {
	// TotalCount: total count of existing namespaces (matching any filters specified).
	TotalCount uint32 `json:"total_count"`
	// Namespaces: namespaces on this page.
	Namespaces []*Namespace `json:"namespaces"`
}

ListNamespacesResponse: list namespaces response.

func (*ListNamespacesResponse) UnsafeAppend

func (r *ListNamespacesResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListNamespacesResponse) UnsafeGetTotalCount

func (r *ListNamespacesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type Namespace

type Namespace struct {
	// ID: namespace ID.
	ID string `json:"id"`
	// Name: namespace name.
	Name string `json:"name"`
	// Endpoint: endpoint of the service matching the namespace's protocol.
	Endpoint string `json:"endpoint"`
	// Protocol: namespace protocol.
	// Default value: unknown
	Protocol NamespaceProtocol `json:"protocol"`
	// ProjectID: project ID of the Project containing the namespace.
	ProjectID string `json:"project_id"`
	// Region: region where the namespace is deployed.
	Region scw.Region `json:"region"`
	// CreatedAt: namespace creation date.
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt: namespace last modification date.
	UpdatedAt *time.Time `json:"updated_at"`
}

Namespace: namespace.

type NamespaceProtocol

type NamespaceProtocol string

func (NamespaceProtocol) MarshalJSON

func (enum NamespaceProtocol) MarshalJSON() ([]byte, error)

func (NamespaceProtocol) String

func (enum NamespaceProtocol) String() string

func (*NamespaceProtocol) UnmarshalJSON

func (enum *NamespaceProtocol) UnmarshalJSON(data []byte) error

type Permissions

type Permissions struct {
	// CanPublish: defines whether the credentials bearer can publish messages to the service (send messages to SQS queues or publish to SNS topics).
	CanPublish *bool `json:"can_publish"`
	// CanReceive: defines whether the credentials bearer can receive messages from the service.
	CanReceive *bool `json:"can_receive"`
	// CanManage: defines whether the credentials bearer can manage the associated resources (SQS queues or SNS topics or subscriptions).
	CanManage *bool `json:"can_manage"`
}

Permissions: permissions.

type UpdateCredentialRequest

type UpdateCredentialRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// CredentialID: ID of the credentials to update.
	CredentialID string `json:"-"`
	// Name: name of the credentials.
	Name *string `json:"name"`
	// Permissions: permissions associated with these credentials.
	Permissions *Permissions `json:"permissions"`
}

type UpdateNamespaceRequest

type UpdateNamespaceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`
	// NamespaceID: ID of the Namespace to update.
	NamespaceID string `json:"namespace_id"`
	// Name: namespace name.
	Name *string `json:"name"`
}

Jump to

Keyboard shortcuts

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