Skip to content

Commit

Permalink
docs(SRV): update doc following user flow revamp MTA-3654 (#2123)
Browse files Browse the repository at this point in the history
* docs(SRV): update doc following user flow revamp MTA-3654

* docs(SRV): update how to

* docs(SRV): update how to create namespace

* docs(SRV): small adjustments

* docs(SRV): fix indents

* docs(SRV): docs review 1
  • Loading branch information
SamyOubouaziz authored Sep 11, 2023
1 parent 09b493c commit b83ca54
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 53 deletions.
37 changes: 22 additions & 15 deletions serverless/functions/how-to/create-a-function.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,32 @@ This page shows you how to deploy a [function](/serverless/functions/concepts/#f
</Message>

1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.
2. Click the functions namespace you want to use to create your function.
3. Click **Create function**. The function creation wizard displays.

2. Click the functions namespace in which you want to create your function.

3. Click **+ Create function**. The function creation wizard displays.

4. Complete the following steps in the wizard:
- Enter your **function code**.
- Set the handler for your function.
- Choose your desired runtime and its version.
- Choose to either use the inline code editor to edit your code directly from your browser in the box provided, or to upload a `*.zip` archive.
- Choose a **name** for your function, and optionally a **description**. The name must only contain alphanumeric characters.
- Choose the **resources** to be allocated to your function at runtime. These define the performance characteristics of your function.
- Set your **scaling** preferences, or leave them at default values. The Scaleway platform autoscales the number of available instances of your function to match the incoming load, depending on the settings you define here.
- Define any **environment variables** you want to inject into your function. For each environment variable, click **+Add** and enter the key/value pair.
- Choose your function's runtime.
- Select **Deploy "Hello world"** if you want to deploy a basic function, **Inline code editor** to enter your own function code, or **Upload a ZIP** to import a [packaged function](/serverless/functions/how-to/package-function-dependencies-in-zip/).
- If you used the code editor, enter the **handler** of your function.
- Enter a **name** or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
- Enter a **description** (optional).
- Select the **resources** to allocate to your function.
- Configure the **scaling** of your function.
<Message type="tip">
Define a minimum of 1 instance or more to avoid cold starts.
</Message>
5. Click **+ Advanced options** and complete the following steps:
- Define any **environment variables** you want to inject into your function. For each environment variable, click **+ Add variable** and enter the key/value pair.
- Set secret environment variables (optional). **Secrets** are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation. Add a **key** and a **value**.
- Set the desired **privacy policy** for your function. This defines whether a function can be executed anonymously (**public**) or only via an authentication mechanism provided by the [Scaleway API](https://www.scaleway.com/en/developers/api/serverless-functions/#authentication) (**private**).
- Click **Advanced Options** if you wish to set a custom timeout for your function.
<Message type="note">
[Triggers](/serverless/functions/concepts/#trigger) can no longer be added from this screen. For more information, refer to the [How to add a trigger to a function](/serverless/functions/how-to/add-trigger-to-a-function/) documentation.
</Message>
- Set the desired timeout for your function.
<Message type="note">
[Triggers](/serverless/functions/concepts/#trigger) can no longer be added from this screen. For more information, refer to the [How to add a trigger to a function](/serverless/functions/how-to/add-trigger-to-a-function/) documentation.
</Message>
- Verify the **estimated cost**.
5. Click **Create function** to finish.
6. Click **Create function** to finish.

<Message type="tip">
There are different ways to deploy Serverless Functions. Refer to our detailed [deployment information](/serverless/functions/reference-content/deploy-function/) for more advanced options to deploy your functions.
Expand Down
20 changes: 10 additions & 10 deletions serverless/functions/how-to/create-a-functions-namespace.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ This page shows you how to create your a functions namespace using the Scaleway
</Message>

1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.
2. Click **Create namespace**. The functions namespace creation wizard displays.
3. Complete namespace information:
- **Name** of your namespace. The first character of your namespace must be a letter. It can only contain letters, numbers, and dashes. No other special characters are permitted. The namespace is case-sensitive and cannot be edited after its creation.
- **Description** (optional).
- **Region** is the geographical location in which your namespace will be deployed.
- **Environment variables** (optional) are key/value pairs that will be available in your functions as environment variables.
- **Secrets** (optional) are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation.
4. Click **Create namespace** to finish.

Your namespace is now created and you are redirected to the **Functions** tab.

2. Click **+ Create namespace**. If you have no existing Serverless Functions resources in your current Project, click **Create a function**. The functions namespace creation wizard displays.

3. Complete the following steps in the wizard:
- Enter a **name** or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
- Enter a **description** (optional).
- Choose a **region**, which is the geographical location in which your namespace will be deployed.
- Define any **environment variables** you want to inject into your function. For each environment variable, click **+ Add variable** and enter the key/value pair.
- Set your secret environment variables (optional). **Secrets** are environment variables which are injected into your function and stored securely, but not displayed in the console after initial validation. Add a **key** and a **value**.
4. Click **Create namespace only** to finish, or click **Create namespace and add a function** if you want to [create a function](/serverless/functions/how-to/create-a-function/) next.

<Navigation title="See Also">
<NextButton to="/serverless/functions/how-to/manage-a-functions-namespace/">How to manage a Serverless Functions namespace</NextButton>
Expand Down
56 changes: 28 additions & 28 deletions serverless/functions/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ content:
paragraph: This page shows you how to get started with Scaleway Functions
tags: functions namespace
dates:
validation: 2023-07-04
validation: 2023-09-07
posted: 2021-05-26
categories:
- serverless
---

Scaleway's [Serverless Functions](https://www.scaleway.com/en/serverless-functions/) platform makes your [functions](/serverless/functions/concepts/#function) available, executes them on demand and manages resource allocation for you.

This page explains how to deploy, invoke and delete a basic Python function using the Scaleway console. For advanced usage, such as larger projects with dependencies, automation, multiple functions and more, [many ways to deploy functions](/serverless/functions/reference-content/deploy-function/) are available.
This page explains how to deploy, invoke and delete a basic Node, Python, or PHP function using the [Scaleway console](https://console.scaleway.com). For advanced usage, such as larger projects with dependencies, automation, multiple functions and more, [many ways to deploy functions](/serverless/functions/reference-content/deploy-function/) are available.

Check out our [scaleway/serverless-examples repository](https://github.com/scaleway/serverless-examples) for advanced examples and use cases.

Expand All @@ -26,43 +26,40 @@ Check out our [scaleway/serverless-examples repository](https://github.com/scale
- You have [cURL](https://everything.curl.dev/get) installed.
</Message>

## How to create a functions namespace

1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.
2. Click **+ Create namespace**. The functions namespace creation wizard displays.
3. Complete the following steps in the wizard:
- Enter a **name** and optionally a **description** for your namespace. The name must start with a letter and can only contain lowercase alphanumeric characters and dashes.
- Choose a **region**, which is the geographical location in which your namespace will be deployed.
4. Click **Create namespace** to finish.
## How to create a function

Your namespace is now created, and you are taken to its **Functions** tab.
If you have no existing Serverless Functions resources in your current Project, the creation process will guide you through the creation of a namespace, and then a function.

<Message type="note">
Refer to the [How to create a Functions namespace](/serverless/functions/how-to/create-a-functions-namespace/) documentation page for more information on the different parameters.
</Message>
1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.

## How to create a function
2. Click **+ Create a function**. The functions [namespace](/serverless/functions/concepts/#namespace) creation wizard displays.

1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.
2. Click the functions namespace you want to use to create your function.
3. Click **+ Create function**. The function creation wizard displays.
4. Enter your **function code**:
- Leave the `handler.handle` default value.
3. Complete the following steps in the wizard:
- Enter a **name** or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
- Enter a **description** (optional).
- Choose a **region**, which is the geographical location in which your namespace will be deployed.
4. Click **Create namespace and add function**. The function creation wizard displays.
<Message type="note">
Refer to the [How to create a Functions namespace](/serverless/functions/how-to/create-a-functions-namespace/) documentation page for more information on the different parameters.
</Message>
5. Complete the following steps in the wizard:
- Choose either **Node**, **Python** or **PHP** as a runtime.
- Leave the default code sample in the editor.
- Choose a **name** for your function, and optionally a **description**. The name can only contain lowercase alphanumeric characters and dashes.
- Select **Deploy "Hello world"** if you want to deploy a basic function, or select **Inline code editor** to enter your own function code.
- If you used the code editor, enter the **handler** of your function.
- Enter a **name** or use the automatically generated one. The name can only contain lowercase alphanumeric characters and dashes.
- Enter a **description** (optional).
- Choose the smallest **resources** available to allocate to your function.
- Leave the default **scaling** values. The Scaleway platform automatically scales the number of available instances of your function to match the incoming load, depending on the settings you define here.
- Set the **Function privacy policy** to public.
- Leave the default **scaling** values.
- In the **Advanced options**, set the **Function privacy policy** to **public**.
- Verify the **estimated cost**.

<Message type="note">
Refer to the [How to create a function](/serverless/functions/how-to/create-a-function/) documentation page for more information on the different parameters.
</Message>
6. Click **Create function**. The deployment takes several minutes to complete. Check the **Overview** tab to see the function's status.

5. Click **Create function**. The deployment will take several minutes to complete. Check the **Overview** tab to see the function's status.
6. Copy the function's endpoint URL from the **Overview** tab.
7. Run the following command in your terminal to invoke your function once it is deployed:
7. Copy the function's endpoint URL from the **Overview** tab.

8. Run the following command in your terminal to invoke your function once it is deployed:

```bash
curl <YOUR_FUNCTION_ENDPOINT>
Expand All @@ -71,8 +68,11 @@ Your namespace is now created, and you are taken to its **Functions** tab.
## How to delete a function

1. Click **Functions** in the **Serverless** section of the side menu. The functions page displays.

2. Click the relevant functions namespace.

3. Click the <Icon name="more" /> icon next to the function you want to delete, and select **Delete** from the dropdown menu.

4. Type **DELETE** in the pop-up that asks you to confirm the action, then click **Delete function**.

<Message type="tip">
Expand Down

0 comments on commit b83ca54

Please sign in to comment.