Documentation
¶
Overview ¶
Package function provides methods and message types of the function v1beta1 API.
Index ¶
- Constants
- type API
- func (s *API) CreateCron(req *CreateCronRequest, opts ...scw.RequestOption) (*Cron, error)
- func (s *API) CreateDomain(req *CreateDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) CreateFunction(req *CreateFunctionRequest, opts ...scw.RequestOption) (*Function, error)
- func (s *API) CreateNamespace(req *CreateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
- func (s *API) CreateToken(req *CreateTokenRequest, opts ...scw.RequestOption) (*Token, error)
- func (s *API) CreateTrigger(req *CreateTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
- func (s *API) DeleteCron(req *DeleteCronRequest, opts ...scw.RequestOption) (*Cron, error)
- func (s *API) DeleteDomain(req *DeleteDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) DeleteFunction(req *DeleteFunctionRequest, opts ...scw.RequestOption) (*Function, error)
- func (s *API) DeleteNamespace(req *DeleteNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
- func (s *API) DeleteToken(req *DeleteTokenRequest, opts ...scw.RequestOption) (*Token, error)
- func (s *API) DeleteTrigger(req *DeleteTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
- func (s *API) DeployFunction(req *DeployFunctionRequest, opts ...scw.RequestOption) (*Function, error)
- func (s *API) GetCron(req *GetCronRequest, opts ...scw.RequestOption) (*Cron, error)
- func (s *API) GetDomain(req *GetDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) GetFunction(req *GetFunctionRequest, opts ...scw.RequestOption) (*Function, error)
- func (s *API) GetFunctionDownloadURL(req *GetFunctionDownloadURLRequest, opts ...scw.RequestOption) (*DownloadURL, error)
- func (s *API) GetFunctionUploadURL(req *GetFunctionUploadURLRequest, opts ...scw.RequestOption) (*UploadURL, error)
- func (s *API) GetNamespace(req *GetNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
- func (s *API) GetToken(req *GetTokenRequest, opts ...scw.RequestOption) (*Token, error)
- func (s *API) GetTrigger(req *GetTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
- func (s *API) ListCrons(req *ListCronsRequest, opts ...scw.RequestOption) (*ListCronsResponse, error)
- func (s *API) ListDomains(req *ListDomainsRequest, opts ...scw.RequestOption) (*ListDomainsResponse, error)
- func (s *API) ListFunctionRuntimes(req *ListFunctionRuntimesRequest, opts ...scw.RequestOption) (*ListFunctionRuntimesResponse, error)
- func (s *API) ListFunctions(req *ListFunctionsRequest, opts ...scw.RequestOption) (*ListFunctionsResponse, error)
- func (s *API) ListNamespaces(req *ListNamespacesRequest, opts ...scw.RequestOption) (*ListNamespacesResponse, error)
- func (s *API) ListTokens(req *ListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error)
- func (s *API) ListTriggers(req *ListTriggersRequest, opts ...scw.RequestOption) (*ListTriggersResponse, error)
- func (s *API) Regions() []scw.Region
- func (s *API) UpdateCron(req *UpdateCronRequest, opts ...scw.RequestOption) (*Cron, error)
- func (s *API) UpdateFunction(req *UpdateFunctionRequest, opts ...scw.RequestOption) (*Function, error)
- func (s *API) UpdateNamespace(req *UpdateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
- func (s *API) UpdateTrigger(req *UpdateTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
- func (s *API) WaitForCron(req *WaitForCronRequest, opts ...scw.RequestOption) (*Cron, error)
- func (s *API) WaitForDomain(req *WaitForDomainRequest, opts ...scw.RequestOption) (*Domain, error)
- func (s *API) WaitForFunction(req *WaitForFunctionRequest, opts ...scw.RequestOption) (*Function, error)
- func (s *API) WaitForNamespace(req *WaitForNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
- func (s *API) WaitForTrigger(req *WaitForTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
- type CreateCronRequest
- type CreateDomainRequest
- type CreateFunctionRequest
- type CreateNamespaceRequest
- type CreateTokenRequest
- type CreateTriggerRequest
- type CreateTriggerRequestMnqNatsClientConfig
- type CreateTriggerRequestMnqSqsClientConfig
- type CreateTriggerRequestSqsClientConfig
- type Cron
- type CronStatus
- type DeleteCronRequest
- type DeleteDomainRequest
- type DeleteFunctionRequest
- type DeleteNamespaceRequest
- type DeleteTokenRequest
- type DeleteTriggerRequest
- type DeployFunctionRequest
- type Domain
- type DomainStatus
- type DownloadURL
- type Function
- type FunctionHTTPOption
- type FunctionPrivacy
- type FunctionRuntime
- type FunctionSandbox
- type FunctionStatus
- type GetCronRequest
- type GetDomainRequest
- type GetFunctionDownloadURLRequest
- type GetFunctionRequest
- type GetFunctionUploadURLRequest
- type GetNamespaceRequest
- type GetTokenRequest
- type GetTriggerRequest
- type ListCronsRequest
- type ListCronsRequestOrderBy
- type ListCronsResponse
- type ListDomainsRequest
- type ListDomainsRequestOrderBy
- type ListDomainsResponse
- type ListFunctionRuntimesRequest
- type ListFunctionRuntimesResponse
- type ListFunctionsRequest
- type ListFunctionsRequestOrderBy
- type ListFunctionsResponse
- type ListNamespacesRequest
- type ListNamespacesRequestOrderBy
- type ListNamespacesResponse
- type ListTokensRequest
- type ListTokensRequestOrderBy
- type ListTokensResponse
- type ListTriggersRequest
- type ListTriggersRequestOrderBy
- type ListTriggersResponse
- type Namespace
- type NamespaceStatus
- type Runtime
- type RuntimeStatus
- type Secret
- type SecretHashedValue
- type Token
- type TokenStatus
- type Trigger
- type TriggerInputType
- type TriggerMnqNatsClientConfig
- type TriggerMnqSqsClientConfig
- type TriggerSqsClientConfig
- type TriggerStatus
- type UpdateCronRequest
- type UpdateFunctionRequest
- type UpdateNamespaceRequest
- type UpdateTriggerRequest
- type UpdateTriggerRequestSqsClientConfig
- type UploadURL
- type WaitForCronRequest
- type WaitForDomainRequest
- type WaitForFunctionRequest
- type WaitForNamespaceRequest
- type WaitForTriggerRequest
Constants ¶
const ( CronStatusUnknown = CronStatus("unknown") CronStatusReady = CronStatus("ready") CronStatusDeleting = CronStatus("deleting") CronStatusError = CronStatus("error") CronStatusLocked = CronStatus("locked") CronStatusCreating = CronStatus("creating") CronStatusPending = CronStatus("pending") )
const ( DomainStatusUnknown = DomainStatus("unknown") DomainStatusReady = DomainStatus("ready") DomainStatusDeleting = DomainStatus("deleting") DomainStatusError = DomainStatus("error") DomainStatusCreating = DomainStatus("creating") DomainStatusPending = DomainStatus("pending") )
const ( FunctionHTTPOptionUnknownHTTPOption = FunctionHTTPOption("unknown_http_option") FunctionHTTPOptionEnabled = FunctionHTTPOption("enabled") FunctionHTTPOptionRedirected = FunctionHTTPOption("redirected") )
const ( FunctionPrivacyUnknownPrivacy = FunctionPrivacy("unknown_privacy") FunctionPrivacyPublic = FunctionPrivacy("public") FunctionPrivacyPrivate = FunctionPrivacy("private") )
const ( FunctionRuntimeUnknownRuntime = FunctionRuntime("unknown_runtime") FunctionRuntimeGolang = FunctionRuntime("golang") FunctionRuntimePython = FunctionRuntime("python") FunctionRuntimePython3 = FunctionRuntime("python3") FunctionRuntimeNode8 = FunctionRuntime("node8") FunctionRuntimeNode10 = FunctionRuntime("node10") FunctionRuntimeNode14 = FunctionRuntime("node14") FunctionRuntimeNode16 = FunctionRuntime("node16") FunctionRuntimeNode17 = FunctionRuntime("node17") FunctionRuntimePython37 = FunctionRuntime("python37") FunctionRuntimePython38 = FunctionRuntime("python38") FunctionRuntimePython39 = FunctionRuntime("python39") FunctionRuntimePython310 = FunctionRuntime("python310") FunctionRuntimeGo113 = FunctionRuntime("go113") FunctionRuntimeGo117 = FunctionRuntime("go117") FunctionRuntimeGo118 = FunctionRuntime("go118") FunctionRuntimeNode18 = FunctionRuntime("node18") FunctionRuntimeRust165 = FunctionRuntime("rust165") FunctionRuntimeGo119 = FunctionRuntime("go119") FunctionRuntimePython311 = FunctionRuntime("python311") FunctionRuntimePhp82 = FunctionRuntime("php82") FunctionRuntimeNode19 = FunctionRuntime("node19") FunctionRuntimeGo120 = FunctionRuntime("go120") FunctionRuntimeNode20 = FunctionRuntime("node20") FunctionRuntimeGo121 = FunctionRuntime("go121") FunctionRuntimeNode22 = FunctionRuntime("node22") FunctionRuntimePython312 = FunctionRuntime("python312") FunctionRuntimePhp83 = FunctionRuntime("php83") FunctionRuntimeGo122 = FunctionRuntime("go122") FunctionRuntimeRust179 = FunctionRuntime("rust179") FunctionRuntimeGo123 = FunctionRuntime("go123") FunctionRuntimeGo124 = FunctionRuntime("go124") FunctionRuntimePython313 = FunctionRuntime("python313") FunctionRuntimeRust185 = FunctionRuntime("rust185") FunctionRuntimePhp84 = FunctionRuntime("php84") )
const ( // Unknown sandbox. FunctionSandboxUnknownSandbox = FunctionSandbox("unknown_sandbox") // Legacy sandboxing with slower cold starts. Fully supports the Linux system call interface. FunctionSandboxV1 = FunctionSandbox("v1") // Recommended sandboxing with faster cold starts. FunctionSandboxV2 = FunctionSandbox("v2") )
const ( FunctionStatusUnknown = FunctionStatus("unknown") FunctionStatusReady = FunctionStatus("ready") FunctionStatusDeleting = FunctionStatus("deleting") FunctionStatusError = FunctionStatus("error") FunctionStatusLocked = FunctionStatus("locked") FunctionStatusCreating = FunctionStatus("creating") FunctionStatusPending = FunctionStatus("pending") FunctionStatusCreated = FunctionStatus("created") )
const ( ListCronsRequestOrderByCreatedAtAsc = ListCronsRequestOrderBy("created_at_asc") ListCronsRequestOrderByCreatedAtDesc = ListCronsRequestOrderBy("created_at_desc") )
const ( ListDomainsRequestOrderByCreatedAtAsc = ListDomainsRequestOrderBy("created_at_asc") ListDomainsRequestOrderByCreatedAtDesc = ListDomainsRequestOrderBy("created_at_desc") ListDomainsRequestOrderByHostnameAsc = ListDomainsRequestOrderBy("hostname_asc") ListDomainsRequestOrderByHostnameDesc = ListDomainsRequestOrderBy("hostname_desc") )
const ( ListFunctionsRequestOrderByCreatedAtAsc = ListFunctionsRequestOrderBy("created_at_asc") ListFunctionsRequestOrderByCreatedAtDesc = ListFunctionsRequestOrderBy("created_at_desc") ListFunctionsRequestOrderByNameAsc = ListFunctionsRequestOrderBy("name_asc") ListFunctionsRequestOrderByNameDesc = ListFunctionsRequestOrderBy("name_desc") )
const ( ListNamespacesRequestOrderByCreatedAtAsc = ListNamespacesRequestOrderBy("created_at_asc") ListNamespacesRequestOrderByCreatedAtDesc = ListNamespacesRequestOrderBy("created_at_desc") ListNamespacesRequestOrderByNameAsc = ListNamespacesRequestOrderBy("name_asc") ListNamespacesRequestOrderByNameDesc = ListNamespacesRequestOrderBy("name_desc") )
const ( ListTokensRequestOrderByCreatedAtAsc = ListTokensRequestOrderBy("created_at_asc") ListTokensRequestOrderByCreatedAtDesc = ListTokensRequestOrderBy("created_at_desc") )
const ( // Order by creation date ascending. ListTriggersRequestOrderByCreatedAtAsc = ListTriggersRequestOrderBy("created_at_asc") // Order by creation date descending. ListTriggersRequestOrderByCreatedAtDesc = ListTriggersRequestOrderBy("created_at_desc") )
const ( NamespaceStatusUnknown = NamespaceStatus("unknown") NamespaceStatusReady = NamespaceStatus("ready") NamespaceStatusDeleting = NamespaceStatus("deleting") NamespaceStatusError = NamespaceStatus("error") NamespaceStatusLocked = NamespaceStatus("locked") NamespaceStatusCreating = NamespaceStatus("creating") NamespaceStatusPending = NamespaceStatus("pending") )
const ( RuntimeStatusUnknownStatus = RuntimeStatus("unknown_status") RuntimeStatusBeta = RuntimeStatus("beta") RuntimeStatusAvailable = RuntimeStatus("available") RuntimeStatusDeprecated = RuntimeStatus("deprecated") RuntimeStatusEndOfSupport = RuntimeStatus("end_of_support") RuntimeStatusEndOfLife = RuntimeStatus("end_of_life") )
const ( TokenStatusUnknown = TokenStatus("unknown") TokenStatusReady = TokenStatus("ready") TokenStatusDeleting = TokenStatus("deleting") TokenStatusError = TokenStatus("error") TokenStatusCreating = TokenStatus("creating") )
const ( // Unknown input type. TriggerInputTypeUnknownInputType = TriggerInputType("unknown_input_type") TriggerInputTypeSqs = TriggerInputType("sqs") // Scaleway Messaging and Queuing SQS queue. TriggerInputTypeScwSqs = TriggerInputType("scw_sqs") TriggerInputTypeNats = TriggerInputType("nats") // Scaleway Messaging and Queuing NATS subject. TriggerInputTypeScwNats = TriggerInputType("scw_nats") )
const ( // Unknown status. TriggerStatusUnknownStatus = TriggerStatus("unknown_status") // Ready status. TriggerStatusReady = TriggerStatus("ready") // Deleting status. TriggerStatusDeleting = TriggerStatus("deleting") // Error status. TriggerStatusError = TriggerStatus("error") // Creating status. TriggerStatusCreating = TriggerStatus("creating") // Pending status. TriggerStatusPending = TriggerStatus("pending") )
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 Serverless Functions.
func (*API) CreateCron ¶
func (s *API) CreateCron(req *CreateCronRequest, opts ...scw.RequestOption) (*Cron, error)
CreateCron: Create a new cronjob for a function with the specified ID.
func (*API) CreateDomain ¶
func (s *API) CreateDomain(req *CreateDomainRequest, opts ...scw.RequestOption) (*Domain, error)
CreateDomain: Create a domain name binding for the function with the specified ID.
func (*API) CreateFunction ¶
func (s *API) CreateFunction(req *CreateFunctionRequest, opts ...scw.RequestOption) (*Function, error)
CreateFunction: Create a new function in the specified region for a specified Organization or Project.
func (*API) CreateNamespace ¶
func (s *API) CreateNamespace(req *CreateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
CreateNamespace: Create a new namespace in a specified Organization or Project.
func (*API) CreateToken ¶
func (s *API) CreateToken(req *CreateTokenRequest, opts ...scw.RequestOption) (*Token, error)
CreateToken: Create a new revocable token.
func (*API) CreateTrigger ¶
func (s *API) CreateTrigger(req *CreateTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
CreateTrigger: Create a new trigger for a specified function.
func (*API) DeleteCron ¶
func (s *API) DeleteCron(req *DeleteCronRequest, opts ...scw.RequestOption) (*Cron, error)
DeleteCron: Delete the cron associated with the specified ID.
func (*API) DeleteDomain ¶
func (s *API) DeleteDomain(req *DeleteDomainRequest, opts ...scw.RequestOption) (*Domain, error)
DeleteDomain: Delete a domain name binding for the function with the specified ID.
func (*API) DeleteFunction ¶
func (s *API) DeleteFunction(req *DeleteFunctionRequest, opts ...scw.RequestOption) (*Function, error)
DeleteFunction: Delete the function associated with the specified ID.
func (*API) DeleteNamespace ¶
func (s *API) DeleteNamespace(req *DeleteNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
DeleteNamespace: Delete the namespace associated with the specified ID.
func (*API) DeleteToken ¶
func (s *API) DeleteToken(req *DeleteTokenRequest, opts ...scw.RequestOption) (*Token, error)
DeleteToken: Delete a token.
func (*API) DeleteTrigger ¶
func (s *API) DeleteTrigger(req *DeleteTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
DeleteTrigger: Delete a trigger with a specified ID.
func (*API) DeployFunction ¶
func (s *API) DeployFunction(req *DeployFunctionRequest, opts ...scw.RequestOption) (*Function, error)
DeployFunction: Deploy a function associated with the specified ID.
func (*API) GetCron ¶
func (s *API) GetCron(req *GetCronRequest, opts ...scw.RequestOption) (*Cron, error)
GetCron: Get the cron associated with the specified ID.
func (*API) GetDomain ¶
func (s *API) GetDomain(req *GetDomainRequest, opts ...scw.RequestOption) (*Domain, error)
GetDomain: Get a domain name binding for the function with the specified ID.
func (*API) GetFunction ¶
func (s *API) GetFunction(req *GetFunctionRequest, opts ...scw.RequestOption) (*Function, error)
GetFunction: Get the function associated with the specified ID.
func (*API) GetFunctionDownloadURL ¶
func (s *API) GetFunctionDownloadURL(req *GetFunctionDownloadURLRequest, opts ...scw.RequestOption) (*DownloadURL, error)
GetFunctionDownloadURL: Get a download URL for a function associated with the specified ID.
func (*API) GetFunctionUploadURL ¶
func (s *API) GetFunctionUploadURL(req *GetFunctionUploadURLRequest, opts ...scw.RequestOption) (*UploadURL, error)
GetFunctionUploadURL: Get an upload URL of a function associated with the specified ID.
func (*API) GetNamespace ¶
func (s *API) GetNamespace(req *GetNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
GetNamespace: Get the namespace associated with the specified ID.
func (*API) GetToken ¶
func (s *API) GetToken(req *GetTokenRequest, opts ...scw.RequestOption) (*Token, error)
GetToken: Get a token.
func (*API) GetTrigger ¶
func (s *API) GetTrigger(req *GetTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
GetTrigger: Get a trigger with a specified ID.
func (*API) ListCrons ¶
func (s *API) ListCrons(req *ListCronsRequest, opts ...scw.RequestOption) (*ListCronsResponse, error)
ListCrons: List all the cronjobs in a specified region.
func (*API) ListDomains ¶
func (s *API) ListDomains(req *ListDomainsRequest, opts ...scw.RequestOption) (*ListDomainsResponse, error)
ListDomains: List all domain name bindings in a specified region.
func (*API) ListFunctionRuntimes ¶
func (s *API) ListFunctionRuntimes(req *ListFunctionRuntimesRequest, opts ...scw.RequestOption) (*ListFunctionRuntimesResponse, error)
ListFunctionRuntimes: List available function runtimes.
func (*API) ListFunctions ¶
func (s *API) ListFunctions(req *ListFunctionsRequest, opts ...scw.RequestOption) (*ListFunctionsResponse, error)
ListFunctions: List all your functions.
func (*API) ListNamespaces ¶
func (s *API) ListNamespaces(req *ListNamespacesRequest, opts ...scw.RequestOption) (*ListNamespacesResponse, error)
ListNamespaces: List all existing namespaces in the specified region.
func (*API) ListTokens ¶
func (s *API) ListTokens(req *ListTokensRequest, opts ...scw.RequestOption) (*ListTokensResponse, error)
ListTokens: List all tokens.
func (*API) ListTriggers ¶
func (s *API) ListTriggers(req *ListTriggersRequest, opts ...scw.RequestOption) (*ListTriggersResponse, error)
ListTriggers: List all triggers belonging to a specified Organization or Project.
func (*API) UpdateCron ¶
func (s *API) UpdateCron(req *UpdateCronRequest, opts ...scw.RequestOption) (*Cron, error)
UpdateCron: Update the cron associated with the specified ID.
func (*API) UpdateFunction ¶
func (s *API) UpdateFunction(req *UpdateFunctionRequest, opts ...scw.RequestOption) (*Function, error)
UpdateFunction: Update the function associated with the specified ID.
When updating a function, the function is automatically redeployed to apply the changes. This behavior can be changed by setting the `redeploy` field to `false` in the request.
func (*API) UpdateNamespace ¶
func (s *API) UpdateNamespace(req *UpdateNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
UpdateNamespace: Update the namespace associated with the specified ID.
func (*API) UpdateTrigger ¶
func (s *API) UpdateTrigger(req *UpdateTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
UpdateTrigger: Update a trigger with a specified ID.
func (*API) WaitForCron ¶
func (s *API) WaitForCron(req *WaitForCronRequest, opts ...scw.RequestOption) (*Cron, error)
WaitForCron waits for the Cron to be in a ready state before returning.
func (*API) WaitForDomain ¶
func (s *API) WaitForDomain(req *WaitForDomainRequest, opts ...scw.RequestOption) (*Domain, error)
WaitForDomain waits for the Domain to be in a ready state before returning.
func (*API) WaitForFunction ¶
func (s *API) WaitForFunction(req *WaitForFunctionRequest, opts ...scw.RequestOption) (*Function, error)
WaitForFunction waits for the Function to be in a ready state before returning.
func (*API) WaitForNamespace ¶
func (s *API) WaitForNamespace(req *WaitForNamespaceRequest, opts ...scw.RequestOption) (*Namespace, error)
WaitForNamespace waits for the Namespace to be in a ready state before returning.
func (*API) WaitForTrigger ¶
func (s *API) WaitForTrigger(req *WaitForTriggerRequest, opts ...scw.RequestOption) (*Trigger, error)
WaitForTrigger waits for the Trigger to be in a ready state before returning.
type CreateCronRequest ¶
type CreateCronRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function to use the cron with.
FunctionID string `json:"function_id"`
// Schedule: schedule of the cron in UNIX cron format.
Schedule string `json:"schedule"`
// Args: arguments to use with the cron.
Args *scw.JSONObject `json:"args,omitempty"`
// Name: name of the cron.
Name *string `json:"name,omitempty"`
}
CreateCronRequest: create cron request.
type CreateDomainRequest ¶
type CreateDomainRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Hostname: hostame to create.
Hostname string `json:"hostname"`
// FunctionID: UUID of the function to associate the domain with.
FunctionID string `json:"function_id"`
}
CreateDomainRequest: create domain request.
type CreateFunctionRequest ¶
type CreateFunctionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Name: name of the function to create.
Name string `json:"name"`
// NamespaceID: UUID of the namespace the function will be created in.
NamespaceID string `json:"namespace_id"`
// EnvironmentVariables: environment variables of the function.
EnvironmentVariables *map[string]string `json:"environment_variables,omitempty"`
// MinScale: minimum number of instances to scale the function to.
MinScale *uint32 `json:"min_scale,omitempty"`
// MaxScale: maximum number of instances to scale the function to.
MaxScale *uint32 `json:"max_scale,omitempty"`
// Runtime: runtime to use with the function.
// Default value: unknown_runtime
Runtime FunctionRuntime `json:"runtime"`
// MemoryLimit: memory limit of the function in MB.
MemoryLimit *uint32 `json:"memory_limit,omitempty"`
// Timeout: request processing time limit for the function.
Timeout *scw.Duration `json:"timeout,omitempty"`
// Handler: handler to use with the function.
Handler *string `json:"handler,omitempty"`
// Privacy: privacy setting of the function.
// Default value: unknown_privacy
Privacy FunctionPrivacy `json:"privacy"`
// Description: description of the function.
Description *string `json:"description,omitempty"`
SecretEnvironmentVariables []*Secret `json:"secret_environment_variables"`
// HTTPOption: possible values:
// - redirected: Responds to HTTP request with a 301 redirect to ask the clients to use HTTPS.
// - enabled: Serve both HTTP and HTTPS traffic.
// Default value: unknown_http_option
HTTPOption FunctionHTTPOption `json:"http_option"`
// Sandbox: execution environment of the function.
// Default value: unknown_sandbox
Sandbox FunctionSandbox `json:"sandbox"`
// Tags: tags of the Serverless Function.
Tags []string `json:"tags"`
// PrivateNetworkID: when connected to a Private Network, the function can access other Scaleway resources in this Private Network.
PrivateNetworkID *string `json:"private_network_id,omitempty"`
}
CreateFunctionRequest: create function request.
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 string `json:"name"`
// EnvironmentVariables: environment variables of the namespace.
EnvironmentVariables *map[string]string `json:"environment_variables,omitempty"`
// ProjectID: UUID of the project in which the namespace will be created.
ProjectID string `json:"project_id"`
// Description: description of the namespace.
Description *string `json:"description,omitempty"`
// SecretEnvironmentVariables: secret environment variables of the namespace.
SecretEnvironmentVariables []*Secret `json:"secret_environment_variables"`
// Tags: tags of the Serverless Function Namespace.
Tags []string `json:"tags"`
// Deprecated: ActivateVpcIntegration: setting this field to true doesn't matter anymore. It will be removed in a near future.
ActivateVpcIntegration *bool `json:"activate_vpc_integration,omitempty"`
}
CreateNamespaceRequest: create namespace request.
type CreateTokenRequest ¶
type CreateTokenRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function to associate the token with.
// Precisely one of FunctionID, NamespaceID must be set.
FunctionID *string `json:"function_id,omitempty"`
// NamespaceID: UUID of the namespace to associate the token with.
// Precisely one of FunctionID, NamespaceID must be set.
NamespaceID *string `json:"namespace_id,omitempty"`
// Description: description of the token.
Description *string `json:"description,omitempty"`
// ExpiresAt: date on which the token expires.
ExpiresAt *time.Time `json:"expires_at,omitempty"`
}
CreateTokenRequest: create token request.
type CreateTriggerRequest ¶
type CreateTriggerRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Name: name of the trigger.
Name string `json:"name"`
// FunctionID: ID of the function to trigger.
FunctionID string `json:"function_id"`
// Description: description of the trigger.
Description *string `json:"description,omitempty"`
// ScwSqsConfig: configuration for a Scaleway Messaging and Queuing SQS queue.
// Precisely one of ScwSqsConfig, ScwNatsConfig, SqsConfig must be set.
ScwSqsConfig *CreateTriggerRequestMnqSqsClientConfig `json:"scw_sqs_config,omitempty"`
// ScwNatsConfig: configuration for a Scaleway Messaging and Queuing NATS subject.
// Precisely one of ScwSqsConfig, ScwNatsConfig, SqsConfig must be set.
ScwNatsConfig *CreateTriggerRequestMnqNatsClientConfig `json:"scw_nats_config,omitempty"`
// SqsConfig: configuration for an AWS SQS queue.
// Precisely one of ScwSqsConfig, ScwNatsConfig, SqsConfig must be set.
SqsConfig *CreateTriggerRequestSqsClientConfig `json:"sqs_config,omitempty"`
}
CreateTriggerRequest: create trigger request.
type CreateTriggerRequestMnqNatsClientConfig ¶
type CreateTriggerRequestMnqNatsClientConfig struct {
// Subject: name of the NATS subject the trigger should listen to.
Subject string `json:"subject"`
// MnqNatsAccountID: ID of the Messaging and Queuing NATS account.
MnqNatsAccountID string `json:"mnq_nats_account_id"`
// MnqProjectID: ID of the Messaging and Queuing project.
MnqProjectID string `json:"mnq_project_id"`
// MnqRegion: currently, only the `fr-par` and `nl-ams` regions are available.
MnqRegion string `json:"mnq_region"`
}
CreateTriggerRequestMnqNatsClientConfig: create trigger request mnq nats client config.
type CreateTriggerRequestMnqSqsClientConfig ¶
type CreateTriggerRequestMnqSqsClientConfig struct {
// Queue: name of the SQS queue the trigger should listen to.
Queue string `json:"queue"`
// MnqProjectID: you must have activated SQS on this project.
MnqProjectID string `json:"mnq_project_id"`
// MnqRegion: currently, only the `fr-par` and `nl-ams` regions are available.
MnqRegion string `json:"mnq_region"`
}
CreateTriggerRequestMnqSqsClientConfig: create trigger request mnq sqs client config.
type CreateTriggerRequestSqsClientConfig ¶
type CreateTriggerRequestSqsClientConfig struct {
Endpoint string `json:"endpoint"`
QueueURL string `json:"queue_url"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
}
CreateTriggerRequestSqsClientConfig: create trigger request sqs client config.
type Cron ¶
type Cron struct {
// ID: UUID of the cron.
ID string `json:"id"`
// FunctionID: UUID of the function the cron applies to.
FunctionID string `json:"function_id"`
// Schedule: schedule of the cron.
Schedule string `json:"schedule"`
// Args: arguments to pass with the cron.
Args *scw.JSONObject `json:"args"`
// Status: status of the cron.
// Default value: unknown
Status CronStatus `json:"status"`
// Name: name of the cron.
Name string `json:"name"`
}
Cron: cron.
type CronStatus ¶
type CronStatus string
func (CronStatus) MarshalJSON ¶
func (enum CronStatus) MarshalJSON() ([]byte, error)
func (CronStatus) String ¶
func (enum CronStatus) String() string
func (*CronStatus) UnmarshalJSON ¶
func (enum *CronStatus) UnmarshalJSON(data []byte) error
func (CronStatus) Values ¶
func (enum CronStatus) Values() []CronStatus
type DeleteCronRequest ¶
type DeleteCronRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// CronID: UUID of the cron to delete.
CronID string `json:"-"`
}
DeleteCronRequest: delete cron request.
type DeleteDomainRequest ¶
type DeleteDomainRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// DomainID: UUID of the domain to delete.
DomainID string `json:"-"`
}
DeleteDomainRequest: delete domain request.
type DeleteFunctionRequest ¶
type DeleteFunctionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function to delete.
FunctionID string `json:"-"`
}
DeleteFunctionRequest: delete function request.
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: UUID of the namespace.
NamespaceID string `json:"-"`
}
DeleteNamespaceRequest: delete namespace request.
type DeleteTokenRequest ¶
type DeleteTokenRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// TokenID: UUID of the token to delete.
TokenID string `json:"-"`
}
DeleteTokenRequest: delete token request.
type DeleteTriggerRequest ¶
type DeleteTriggerRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// TriggerID: ID of the trigger to delete.
TriggerID string `json:"-"`
}
DeleteTriggerRequest: delete trigger request.
type DeployFunctionRequest ¶
type DeployFunctionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function to deploy.
FunctionID string `json:"-"`
}
DeployFunctionRequest: deploy function request.
type Domain ¶
type Domain struct {
// ID: UUID of the domain.
ID string `json:"id"`
// Hostname: hostname associated with the function.
Hostname string `json:"hostname"`
// FunctionID: UUID of the function the domain is associated with.
FunctionID string `json:"function_id"`
// URL: URL of the function.
URL string `json:"url"`
// Status: state of the doamin.
// Default value: unknown
Status DomainStatus `json:"status"`
// ErrorMessage: error message if the domain is in "error" state.
ErrorMessage *string `json:"error_message"`
}
Domain: domain.
type DomainStatus ¶
type DomainStatus string
func (DomainStatus) MarshalJSON ¶
func (enum DomainStatus) MarshalJSON() ([]byte, error)
func (DomainStatus) String ¶
func (enum DomainStatus) String() string
func (*DomainStatus) UnmarshalJSON ¶
func (enum *DomainStatus) UnmarshalJSON(data []byte) error
func (DomainStatus) Values ¶
func (enum DomainStatus) Values() []DomainStatus
type DownloadURL ¶
DownloadURL: download url.
type Function ¶
type Function struct {
// ID: UUID of the function.
ID string `json:"id"`
// Name: name of the function.
Name string `json:"name"`
// NamespaceID: UUID of the namespace the function belongs to.
NamespaceID string `json:"namespace_id"`
// Status: status of the function.
// Default value: unknown
Status FunctionStatus `json:"status"`
// EnvironmentVariables: environment variables of the function.
EnvironmentVariables map[string]string `json:"environment_variables"`
// MinScale: minimum number of instances to scale the function to.
MinScale uint32 `json:"min_scale"`
// MaxScale: maximum number of instances to scale the function to.
MaxScale uint32 `json:"max_scale"`
// Runtime: runtime of the function.
// Default value: unknown_runtime
Runtime FunctionRuntime `json:"runtime"`
// MemoryLimit: memory limit of the function in MB.
MemoryLimit uint32 `json:"memory_limit"`
// CPULimit: CPU limit of the function.
CPULimit uint32 `json:"cpu_limit"`
// Timeout: request processing time limit for the function.
Timeout *scw.Duration `json:"timeout"`
// Handler: handler to use for the function.
Handler string `json:"handler"`
// ErrorMessage: error message if the function is in "error" state.
ErrorMessage *string `json:"error_message"`
// BuildMessage: description of the current build step.
BuildMessage *string `json:"build_message"`
// Privacy: privacy setting of the function.
// Default value: unknown_privacy
Privacy FunctionPrivacy `json:"privacy"`
// Description: description of the function.
Description *string `json:"description"`
// DomainName: domain name associated with the function.
DomainName string `json:"domain_name"`
// SecretEnvironmentVariables: secret environment variables of the function.
SecretEnvironmentVariables []*SecretHashedValue `json:"secret_environment_variables"`
// Region: region in which the function is deployed.
Region scw.Region `json:"region"`
// HTTPOption: possible values:
// - redirected: Responds to HTTP request with a 301 redirect to ask the clients to use HTTPS.
// - enabled: Serve both HTTP and HTTPS traffic.
// Default value: unknown_http_option
HTTPOption FunctionHTTPOption `json:"http_option"`
RuntimeMessage string `json:"runtime_message"`
// Sandbox: execution environment of the function.
// Default value: unknown_sandbox
Sandbox FunctionSandbox `json:"sandbox"`
// CreatedAt: creation date of the function.
CreatedAt *time.Time `json:"created_at"`
// UpdatedAt: last update date of the function.
UpdatedAt *time.Time `json:"updated_at"`
// ReadyAt: last date when the function was successfully deployed and set to ready.
ReadyAt *time.Time `json:"ready_at"`
// Tags: list of tags applied to the Serverless Function.
Tags []string `json:"tags"`
// PrivateNetworkID: when connected to a Private Network, the function can access other Scaleway resources in this Private Network.
PrivateNetworkID *string `json:"private_network_id"`
}
Function: function.
type FunctionHTTPOption ¶
type FunctionHTTPOption string
func (FunctionHTTPOption) MarshalJSON ¶
func (enum FunctionHTTPOption) MarshalJSON() ([]byte, error)
func (FunctionHTTPOption) String ¶
func (enum FunctionHTTPOption) String() string
func (*FunctionHTTPOption) UnmarshalJSON ¶
func (enum *FunctionHTTPOption) UnmarshalJSON(data []byte) error
func (FunctionHTTPOption) Values ¶
func (enum FunctionHTTPOption) Values() []FunctionHTTPOption
type FunctionPrivacy ¶
type FunctionPrivacy string
func (FunctionPrivacy) MarshalJSON ¶
func (enum FunctionPrivacy) MarshalJSON() ([]byte, error)
func (FunctionPrivacy) String ¶
func (enum FunctionPrivacy) String() string
func (*FunctionPrivacy) UnmarshalJSON ¶
func (enum *FunctionPrivacy) UnmarshalJSON(data []byte) error
func (FunctionPrivacy) Values ¶
func (enum FunctionPrivacy) Values() []FunctionPrivacy
type FunctionRuntime ¶
type FunctionRuntime string
func (FunctionRuntime) MarshalJSON ¶
func (enum FunctionRuntime) MarshalJSON() ([]byte, error)
func (FunctionRuntime) String ¶
func (enum FunctionRuntime) String() string
func (*FunctionRuntime) UnmarshalJSON ¶
func (enum *FunctionRuntime) UnmarshalJSON(data []byte) error
func (FunctionRuntime) Values ¶
func (enum FunctionRuntime) Values() []FunctionRuntime
type FunctionSandbox ¶
type FunctionSandbox string
func (FunctionSandbox) MarshalJSON ¶
func (enum FunctionSandbox) MarshalJSON() ([]byte, error)
func (FunctionSandbox) String ¶
func (enum FunctionSandbox) String() string
func (*FunctionSandbox) UnmarshalJSON ¶
func (enum *FunctionSandbox) UnmarshalJSON(data []byte) error
func (FunctionSandbox) Values ¶
func (enum FunctionSandbox) Values() []FunctionSandbox
type FunctionStatus ¶
type FunctionStatus string
func (FunctionStatus) MarshalJSON ¶
func (enum FunctionStatus) MarshalJSON() ([]byte, error)
func (FunctionStatus) String ¶
func (enum FunctionStatus) String() string
func (*FunctionStatus) UnmarshalJSON ¶
func (enum *FunctionStatus) UnmarshalJSON(data []byte) error
func (FunctionStatus) Values ¶
func (enum FunctionStatus) Values() []FunctionStatus
type GetCronRequest ¶
type GetCronRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// CronID: UUID of the cron to get.
CronID string `json:"-"`
}
GetCronRequest: get cron request.
type GetDomainRequest ¶
type GetDomainRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// DomainID: UUID of the domain to get.
DomainID string `json:"-"`
}
GetDomainRequest: get domain request.
type GetFunctionDownloadURLRequest ¶
type GetFunctionDownloadURLRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function to get the download URL for.
FunctionID string `json:"-"`
}
GetFunctionDownloadURLRequest: get function download url request.
type GetFunctionRequest ¶
type GetFunctionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function.
FunctionID string `json:"-"`
}
GetFunctionRequest: get function request.
type GetFunctionUploadURLRequest ¶
type GetFunctionUploadURLRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function to get the upload URL for.
FunctionID string `json:"-"`
// ContentLength: size of the archive to upload in bytes.
ContentLength uint64 `json:"content_length"`
}
GetFunctionUploadURLRequest: get function upload url request.
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: UUID of the namespace.
NamespaceID string `json:"-"`
}
GetNamespaceRequest: get namespace request.
type GetTokenRequest ¶
type GetTokenRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// TokenID: UUID of the token to get.
TokenID string `json:"-"`
}
GetTokenRequest: get token request.
type GetTriggerRequest ¶
type GetTriggerRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// TriggerID: ID of the trigger to get.
TriggerID string `json:"-"`
}
GetTriggerRequest: get trigger request.
type ListCronsRequest ¶
type ListCronsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Page: page number.
Page *int32 `json:"-"`
// PageSize: number of crons per page.
PageSize *uint32 `json:"-"`
// OrderBy: order of the crons.
// Default value: created_at_asc
OrderBy ListCronsRequestOrderBy `json:"-"`
// FunctionID: UUID of the function.
FunctionID string `json:"-"`
}
ListCronsRequest: list crons request.
type ListCronsRequestOrderBy ¶
type ListCronsRequestOrderBy string
func (ListCronsRequestOrderBy) MarshalJSON ¶
func (enum ListCronsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListCronsRequestOrderBy) String ¶
func (enum ListCronsRequestOrderBy) String() string
func (*ListCronsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListCronsRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListCronsRequestOrderBy) Values ¶
func (enum ListCronsRequestOrderBy) Values() []ListCronsRequestOrderBy
type ListCronsResponse ¶
type ListCronsResponse struct {
// Crons: array of crons.
Crons []*Cron `json:"crons"`
// TotalCount: total number of crons.
TotalCount uint32 `json:"total_count"`
}
ListCronsResponse: list crons response.
func (*ListCronsResponse) UnsafeAppend ¶
func (r *ListCronsResponse) UnsafeAppend(res any) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListCronsResponse) UnsafeGetTotalCount ¶
func (r *ListCronsResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListDomainsRequest ¶
type ListDomainsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Page: page number.
Page *int32 `json:"-"`
// PageSize: number of domains per page.
PageSize *uint32 `json:"-"`
// OrderBy: order of the domains.
// Default value: created_at_asc
OrderBy ListDomainsRequestOrderBy `json:"-"`
// FunctionID: UUID of the function the domain is associated with.
FunctionID string `json:"-"`
}
ListDomainsRequest: list domains request.
type ListDomainsRequestOrderBy ¶
type ListDomainsRequestOrderBy string
func (ListDomainsRequestOrderBy) MarshalJSON ¶
func (enum ListDomainsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListDomainsRequestOrderBy) String ¶
func (enum ListDomainsRequestOrderBy) String() string
func (*ListDomainsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListDomainsRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListDomainsRequestOrderBy) Values ¶
func (enum ListDomainsRequestOrderBy) Values() []ListDomainsRequestOrderBy
type ListDomainsResponse ¶
type ListDomainsResponse struct {
// Domains: array of domains.
Domains []*Domain `json:"domains"`
// TotalCount: total number of domains.
TotalCount uint32 `json:"total_count"`
}
ListDomainsResponse: list domains response.
func (*ListDomainsResponse) UnsafeAppend ¶
func (r *ListDomainsResponse) UnsafeAppend(res any) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListDomainsResponse) UnsafeGetTotalCount ¶
func (r *ListDomainsResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListFunctionRuntimesRequest ¶
type ListFunctionRuntimesRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
}
ListFunctionRuntimesRequest: list function runtimes request.
type ListFunctionRuntimesResponse ¶
type ListFunctionRuntimesResponse struct {
// Runtimes: array of runtimes available.
Runtimes []*Runtime `json:"runtimes"`
// TotalCount: total number of runtimes.
TotalCount uint32 `json:"total_count"`
}
ListFunctionRuntimesResponse: list function runtimes response.
func (*ListFunctionRuntimesResponse) UnsafeAppend ¶
func (r *ListFunctionRuntimesResponse) UnsafeAppend(res any) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListFunctionRuntimesResponse) UnsafeGetTotalCount ¶
func (r *ListFunctionRuntimesResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListFunctionsRequest ¶
type ListFunctionsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Page: page number.
Page *int32 `json:"-"`
// PageSize: number of functions per page.
PageSize *uint32 `json:"-"`
// OrderBy: order of the functions.
// Default value: created_at_asc
OrderBy ListFunctionsRequestOrderBy `json:"-"`
// NamespaceID: UUID of the namespace the function belongs to.
NamespaceID string `json:"-"`
// Name: name of the function.
Name *string `json:"-"`
// OrganizationID: UUID of the Organization the function belongs to.
OrganizationID *string `json:"-"`
// ProjectID: UUID of the Project the function belongs to.
ProjectID *string `json:"-"`
}
ListFunctionsRequest: list functions request.
type ListFunctionsRequestOrderBy ¶
type ListFunctionsRequestOrderBy string
func (ListFunctionsRequestOrderBy) MarshalJSON ¶
func (enum ListFunctionsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListFunctionsRequestOrderBy) String ¶
func (enum ListFunctionsRequestOrderBy) String() string
func (*ListFunctionsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListFunctionsRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListFunctionsRequestOrderBy) Values ¶
func (enum ListFunctionsRequestOrderBy) Values() []ListFunctionsRequestOrderBy
type ListFunctionsResponse ¶
type ListFunctionsResponse struct {
// Functions: array of functions.
Functions []*Function `json:"functions"`
// TotalCount: total number of functions.
TotalCount uint32 `json:"total_count"`
}
ListFunctionsResponse: list functions response.
func (*ListFunctionsResponse) UnsafeAppend ¶
func (r *ListFunctionsResponse) UnsafeAppend(res any) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListFunctionsResponse) UnsafeGetTotalCount ¶
func (r *ListFunctionsResponse) 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:"-"`
// Page: page number.
Page *int32 `json:"-"`
// PageSize: number of namespaces per page.
PageSize *uint32 `json:"-"`
// OrderBy: order of the namespaces.
// Default value: created_at_asc
OrderBy ListNamespacesRequestOrderBy `json:"-"`
// Name: name of the namespace.
Name *string `json:"-"`
// OrganizationID: UUID of the Organization the namespace belongs to.
OrganizationID *string `json:"-"`
// ProjectID: UUID of the Project the namespace belongs to.
ProjectID *string `json:"-"`
}
ListNamespacesRequest: list namespaces request.
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
func (ListNamespacesRequestOrderBy) Values ¶
func (enum ListNamespacesRequestOrderBy) Values() []ListNamespacesRequestOrderBy
type ListNamespacesResponse ¶
type ListNamespacesResponse struct {
Namespaces []*Namespace `json:"namespaces"`
// TotalCount: total number of namespaces.
TotalCount uint32 `json:"total_count"`
}
ListNamespacesResponse: list namespaces response.
func (*ListNamespacesResponse) UnsafeAppend ¶
func (r *ListNamespacesResponse) UnsafeAppend(res any) (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 ListTokensRequest ¶
type ListTokensRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Page: page number.
Page *int32 `json:"-"`
// PageSize: number of tokens per page.
PageSize *uint32 `json:"-"`
// OrderBy: sort order for the tokens.
// Default value: created_at_asc
OrderBy ListTokensRequestOrderBy `json:"-"`
// FunctionID: UUID of the function the token is associated with.
FunctionID *string `json:"-"`
// NamespaceID: UUID of the namespace the token is associated with.
NamespaceID *string `json:"-"`
}
ListTokensRequest: list tokens request.
type ListTokensRequestOrderBy ¶
type ListTokensRequestOrderBy string
func (ListTokensRequestOrderBy) MarshalJSON ¶
func (enum ListTokensRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListTokensRequestOrderBy) String ¶
func (enum ListTokensRequestOrderBy) String() string
func (*ListTokensRequestOrderBy) UnmarshalJSON ¶
func (enum *ListTokensRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListTokensRequestOrderBy) Values ¶
func (enum ListTokensRequestOrderBy) Values() []ListTokensRequestOrderBy
type ListTokensResponse ¶
type ListTokensResponse struct {
Tokens []*Token `json:"tokens"`
TotalCount uint32 `json:"total_count"`
}
ListTokensResponse: list tokens response.
func (*ListTokensResponse) UnsafeAppend ¶
func (r *ListTokensResponse) UnsafeAppend(res any) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListTokensResponse) UnsafeGetTotalCount ¶
func (r *ListTokensResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type ListTriggersRequest ¶
type ListTriggersRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Page: page number to return.
Page *int32 `json:"-"`
// PageSize: maximum number of triggers to return per page.
PageSize *uint32 `json:"-"`
// OrderBy: order in which to return results.
// Default value: created_at_asc
OrderBy ListTriggersRequestOrderBy `json:"-"`
// FunctionID: ID of the function the triggers belongs to.
// Precisely one of FunctionID, NamespaceID, ProjectID must be set.
FunctionID *string `json:"function_id,omitempty"`
// NamespaceID: ID of the namespace the triggers belongs to.
// Precisely one of FunctionID, NamespaceID, ProjectID must be set.
NamespaceID *string `json:"namespace_id,omitempty"`
// ProjectID: ID of the project the triggers belongs to.
// Precisely one of FunctionID, NamespaceID, ProjectID must be set.
ProjectID *string `json:"project_id,omitempty"`
}
ListTriggersRequest: list triggers request.
type ListTriggersRequestOrderBy ¶
type ListTriggersRequestOrderBy string
func (ListTriggersRequestOrderBy) MarshalJSON ¶
func (enum ListTriggersRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListTriggersRequestOrderBy) String ¶
func (enum ListTriggersRequestOrderBy) String() string
func (*ListTriggersRequestOrderBy) UnmarshalJSON ¶
func (enum *ListTriggersRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListTriggersRequestOrderBy) Values ¶
func (enum ListTriggersRequestOrderBy) Values() []ListTriggersRequestOrderBy
type ListTriggersResponse ¶
type ListTriggersResponse struct {
// TotalCount: total count of existing triggers (matching any filters specified).
TotalCount uint32 `json:"total_count"`
// Triggers: triggers on this page.
Triggers []*Trigger `json:"triggers"`
}
ListTriggersResponse: list triggers response.
func (*ListTriggersResponse) UnsafeAppend ¶
func (r *ListTriggersResponse) UnsafeAppend(res any) (uint32, error)
UnsafeAppend should not be used Internal usage only
func (*ListTriggersResponse) UnsafeGetTotalCount ¶
func (r *ListTriggersResponse) UnsafeGetTotalCount() uint32
UnsafeGetTotalCount should not be used Internal usage only
type Namespace ¶
type Namespace struct {
// ID: UUID of the namespace.
ID string `json:"id"`
// Name: name of the namespace.
Name string `json:"name"`
// EnvironmentVariables: environment variables of the namespace.
EnvironmentVariables map[string]string `json:"environment_variables"`
// OrganizationID: UUID of the Organization the namespace belongs to.
OrganizationID string `json:"organization_id"`
// ProjectID: UUID of the Project the namespace belongs to.
ProjectID string `json:"project_id"`
// Status: status of the namespace.
// Default value: unknown
Status NamespaceStatus `json:"status"`
// RegistryNamespaceID: UUID of the registry namespace.
RegistryNamespaceID string `json:"registry_namespace_id"`
// ErrorMessage: error message if the namespace is in "error" state.
ErrorMessage *string `json:"error_message"`
// RegistryEndpoint: registry endpoint of the namespace.
RegistryEndpoint string `json:"registry_endpoint"`
// Description: description of the namespace.
Description *string `json:"description"`
// SecretEnvironmentVariables: secret environment variables of the namespace.
SecretEnvironmentVariables []*SecretHashedValue `json:"secret_environment_variables"`
// Region: region in which the namespace is located.
Region scw.Region `json:"region"`
// Tags: list of tags applied to the Serverless Function Namespace.
Tags []string `json:"tags"`
// CreatedAt: creation date of the namespace.
CreatedAt *time.Time `json:"created_at"`
// UpdatedAt: last update date of the namespace.
UpdatedAt *time.Time `json:"updated_at"`
// Deprecated: VpcIntegrationActivated: the value of this field doesn't matter anymore, and will be removed in a near future.
VpcIntegrationActivated *bool `json:"vpc_integration_activated,omitempty"`
}
Namespace: namespace.
type NamespaceStatus ¶
type NamespaceStatus string
func (NamespaceStatus) MarshalJSON ¶
func (enum NamespaceStatus) MarshalJSON() ([]byte, error)
func (NamespaceStatus) String ¶
func (enum NamespaceStatus) String() string
func (*NamespaceStatus) UnmarshalJSON ¶
func (enum *NamespaceStatus) UnmarshalJSON(data []byte) error
func (NamespaceStatus) Values ¶
func (enum NamespaceStatus) Values() []NamespaceStatus
type Runtime ¶
type Runtime struct {
Name string `json:"name"`
Language string `json:"language"`
Version string `json:"version"`
DefaultHandler string `json:"default_handler"`
CodeSample string `json:"code_sample"`
// Status: default value: unknown_status
Status RuntimeStatus `json:"status"`
StatusMessage string `json:"status_message"`
Extension string `json:"extension"`
Implementation string `json:"implementation"`
LogoURL string `json:"logo_url"`
}
Runtime: runtime.
type RuntimeStatus ¶
type RuntimeStatus string
func (RuntimeStatus) MarshalJSON ¶
func (enum RuntimeStatus) MarshalJSON() ([]byte, error)
func (RuntimeStatus) String ¶
func (enum RuntimeStatus) String() string
func (*RuntimeStatus) UnmarshalJSON ¶
func (enum *RuntimeStatus) UnmarshalJSON(data []byte) error
func (RuntimeStatus) Values ¶
func (enum RuntimeStatus) Values() []RuntimeStatus
type SecretHashedValue ¶
SecretHashedValue: secret hashed value.
type Token ¶
type Token struct {
// ID: UUID of the token.
ID string `json:"id"`
// Token: string of the token.
Token string `json:"token"`
// FunctionID: UUID of the function the token is associated with.
// Precisely one of FunctionID, NamespaceID must be set.
FunctionID *string `json:"function_id,omitempty"`
// NamespaceID: UUID of the namespace the token is associated with.
// Precisely one of FunctionID, NamespaceID must be set.
NamespaceID *string `json:"namespace_id,omitempty"`
// Deprecated: PublicKey: public key of the token.
PublicKey *string `json:"public_key,omitempty"`
// Status: status of the token.
// Default value: unknown
Status TokenStatus `json:"status"`
// Description: description of the token.
Description *string `json:"description"`
// ExpiresAt: date on which the token expires.
ExpiresAt *time.Time `json:"expires_at"`
}
Token: token.
type TokenStatus ¶
type TokenStatus string
func (TokenStatus) MarshalJSON ¶
func (enum TokenStatus) MarshalJSON() ([]byte, error)
func (TokenStatus) String ¶
func (enum TokenStatus) String() string
func (*TokenStatus) UnmarshalJSON ¶
func (enum *TokenStatus) UnmarshalJSON(data []byte) error
func (TokenStatus) Values ¶
func (enum TokenStatus) Values() []TokenStatus
type Trigger ¶
type Trigger struct {
// ID: ID of the trigger.
ID string `json:"id"`
// Name: name of the trigger.
Name string `json:"name"`
// Description: description of the trigger.
Description string `json:"description"`
// FunctionID: ID of the function to trigger.
FunctionID string `json:"function_id"`
// InputType: type of the input.
// Default value: unknown_input_type
InputType TriggerInputType `json:"input_type"`
// Status: status of the trigger.
// Default value: unknown_status
Status TriggerStatus `json:"status"`
// ErrorMessage: error message of the trigger.
ErrorMessage *string `json:"error_message"`
// ScwSqsConfig: configuration for a Scaleway Messaging and Queuing SQS queue.
// Precisely one of ScwSqsConfig, ScwNatsConfig, SqsConfig must be set.
ScwSqsConfig *TriggerMnqSqsClientConfig `json:"scw_sqs_config,omitempty"`
// ScwNatsConfig: configuration for a Scaleway Messaging and Queuing NATS subject.
// Precisely one of ScwSqsConfig, ScwNatsConfig, SqsConfig must be set.
ScwNatsConfig *TriggerMnqNatsClientConfig `json:"scw_nats_config,omitempty"`
// SqsConfig: configuration for an AWS SQS queue.
// Precisely one of ScwSqsConfig, ScwNatsConfig, SqsConfig must be set.
SqsConfig *TriggerSqsClientConfig `json:"sqs_config,omitempty"`
}
Trigger: trigger.
type TriggerInputType ¶
type TriggerInputType string
func (TriggerInputType) MarshalJSON ¶
func (enum TriggerInputType) MarshalJSON() ([]byte, error)
func (TriggerInputType) String ¶
func (enum TriggerInputType) String() string
func (*TriggerInputType) UnmarshalJSON ¶
func (enum *TriggerInputType) UnmarshalJSON(data []byte) error
func (TriggerInputType) Values ¶
func (enum TriggerInputType) Values() []TriggerInputType
type TriggerMnqNatsClientConfig ¶
type TriggerMnqNatsClientConfig struct {
// Subject: name of the NATS subject the trigger listens to.
Subject string `json:"subject"`
// MnqNatsAccountID: ID of the Messaging and Queuing NATS account.
MnqNatsAccountID string `json:"mnq_nats_account_id"`
// MnqProjectID: ID of the Messaging and Queuing project.
MnqProjectID string `json:"mnq_project_id"`
// MnqRegion: currently, only the `fr-par` and `nl-ams` regions are available.
MnqRegion string `json:"mnq_region"`
// MnqCredentialID: ID of the Messaging and Queuing credentials used to subscribe to the NATS subject.
MnqCredentialID *string `json:"mnq_credential_id"`
}
TriggerMnqNatsClientConfig: trigger mnq nats client config.
type TriggerMnqSqsClientConfig ¶
type TriggerMnqSqsClientConfig struct {
// Queue: name of the SQS queue the trigger listens to.
Queue string `json:"queue"`
// MnqProjectID: ID of the Messaging and Queuing project.
MnqProjectID string `json:"mnq_project_id"`
// MnqRegion: currently, only the `fr-par` and `nl-ams` regions are available.
MnqRegion string `json:"mnq_region"`
// MnqCredentialID: ID of the Messaging and Queuing credentials used to read from the SQS queue.
MnqCredentialID *string `json:"mnq_credential_id"`
}
TriggerMnqSqsClientConfig: trigger mnq sqs client config.
type TriggerSqsClientConfig ¶
type TriggerSqsClientConfig struct {
Endpoint string `json:"endpoint"`
QueueURL string `json:"queue_url"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
}
TriggerSqsClientConfig: trigger sqs client config.
type TriggerStatus ¶
type TriggerStatus string
func (TriggerStatus) MarshalJSON ¶
func (enum TriggerStatus) MarshalJSON() ([]byte, error)
func (TriggerStatus) String ¶
func (enum TriggerStatus) String() string
func (*TriggerStatus) UnmarshalJSON ¶
func (enum *TriggerStatus) UnmarshalJSON(data []byte) error
func (TriggerStatus) Values ¶
func (enum TriggerStatus) Values() []TriggerStatus
type UpdateCronRequest ¶
type UpdateCronRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// CronID: UUID of the cron to update.
CronID string `json:"-"`
// FunctionID: UUID of the function to use the cron with.
FunctionID *string `json:"function_id,omitempty"`
// Schedule: schedule of the cron in UNIX cron format.
Schedule *string `json:"schedule,omitempty"`
// Args: arguments to use with the cron.
Args *scw.JSONObject `json:"args,omitempty"`
// Name: name of the cron.
Name *string `json:"name,omitempty"`
}
UpdateCronRequest: update cron request.
type UpdateFunctionRequest ¶
type UpdateFunctionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// FunctionID: UUID of the function to update.
FunctionID string `json:"-"`
// EnvironmentVariables: environment variables of the function to update.
EnvironmentVariables *map[string]string `json:"environment_variables,omitempty"`
// MinScale: minimum number of instances to scale the function to.
MinScale *uint32 `json:"min_scale,omitempty"`
// MaxScale: maximum number of instances to scale the function to.
MaxScale *uint32 `json:"max_scale,omitempty"`
// Runtime: runtime to use with the function.
// Default value: unknown_runtime
Runtime FunctionRuntime `json:"runtime"`
// MemoryLimit: memory limit of the function in MB.
MemoryLimit *uint32 `json:"memory_limit,omitempty"`
// Timeout: processing time limit for the function.
Timeout *scw.Duration `json:"timeout,omitempty"`
// Redeploy: redeploy failed function.
Redeploy *bool `json:"redeploy,omitempty"`
// Handler: handler to use with the function.
Handler *string `json:"handler,omitempty"`
// Privacy: privacy setting of the function.
// Default value: unknown_privacy
Privacy FunctionPrivacy `json:"privacy"`
// Description: description of the function.
Description *string `json:"description,omitempty"`
// SecretEnvironmentVariables: during an update, secret environment variables that are not specified in this field will be kept unchanged.
//
// In order to delete a specific secret environment variable, you must reference its key, but not provide any value for it.
// For example, the following payload will delete the `TO_DELETE` secret environment variable:
//
// “`json
// {
// "secret_environment_variables":[
// {"key":"TO_DELETE"}
// ]
// }
// “`.
SecretEnvironmentVariables []*Secret `json:"secret_environment_variables"`
// HTTPOption: possible values:
// - redirected: Responds to HTTP request with a 301 redirect to ask the clients to use HTTPS.
// - enabled: Serve both HTTP and HTTPS traffic.
// Default value: unknown_http_option
HTTPOption FunctionHTTPOption `json:"http_option"`
// Sandbox: execution environment of the function.
// Default value: unknown_sandbox
Sandbox FunctionSandbox `json:"sandbox"`
// Tags: tags of the Serverless Function.
Tags *[]string `json:"tags,omitempty"`
// PrivateNetworkID: when connected to a Private Network, the function can access other Scaleway resources in this Private Network.
PrivateNetworkID *string `json:"private_network_id,omitempty"`
}
UpdateFunctionRequest: update function request.
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: UUID of the namespapce.
NamespaceID string `json:"-"`
// EnvironmentVariables: environment variables of the namespace.
EnvironmentVariables *map[string]string `json:"environment_variables,omitempty"`
// Description: description of the namespace.
Description *string `json:"description,omitempty"`
// SecretEnvironmentVariables: secret environment variables of the namespace.
SecretEnvironmentVariables []*Secret `json:"secret_environment_variables"`
// Tags: tags of the Serverless Function Namespace.
Tags *[]string `json:"tags,omitempty"`
}
UpdateNamespaceRequest: update namespace request.
type UpdateTriggerRequest ¶
type UpdateTriggerRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// TriggerID: ID of the trigger to update.
TriggerID string `json:"-"`
// Name: name of the trigger.
Name *string `json:"name,omitempty"`
// Description: description of the trigger.
Description *string `json:"description,omitempty"`
// SqsConfig: configuration for an AWS SQS queue.
// Precisely one of SqsConfig must be set.
SqsConfig *UpdateTriggerRequestSqsClientConfig `json:"sqs_config,omitempty"`
}
UpdateTriggerRequest: update trigger request.
type UpdateTriggerRequestSqsClientConfig ¶
type UpdateTriggerRequestSqsClientConfig struct {
AccessKey *string `json:"access_key"`
SecretKey *string `json:"secret_key"`
}
UpdateTriggerRequestSqsClientConfig: update trigger request sqs client config.
type UploadURL ¶
type UploadURL struct {
// URL: upload URL to upload the function to.
URL string `json:"url"`
// Headers: HTTP headers.
Headers map[string]*[]string `json:"headers"`
}
UploadURL: upload url.
type WaitForCronRequest ¶
type WaitForCronRequest struct {
CronID string
Region scw.Region
Timeout *time.Duration
RetryInterval *time.Duration
}
WaitForCronRequest is used by WaitForNamespace method.
type WaitForDomainRequest ¶
type WaitForDomainRequest struct {
DomainID string
Region scw.Region
Timeout *time.Duration
RetryInterval *time.Duration
}
WaitForDomainRequest waits for the Domain to be in a ready state before returning.
type WaitForFunctionRequest ¶
type WaitForFunctionRequest struct {
FunctionID string
Region scw.Region
Timeout *time.Duration
RetryInterval *time.Duration
}
WaitForFunctionRequest is used by WaitForNamespace method.