Skip to content

Commit

Permalink
docs(GEN): content review MTA-4314 (#2866)
Browse files Browse the repository at this point in the history
* docs(GEN): content review MTA-4314

* docs(GEN): udapte

* docs(GEN): udapte

* Apply suggestions from code review

Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com>

* docs(GEN): update

* Update package-function-dependencies-in-zip.mdx

* Apply suggestions from code review

Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com>

* docs(GEN): update

---------

Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com>
  • Loading branch information
SamyOubouaziz and jcirinosclwy authored Mar 19, 2024
1 parent 5fbcfaa commit b3702bc
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 57 deletions.
22 changes: 9 additions & 13 deletions console/account/how-to/switch-account-to-corporate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,34 @@ content:
paragraph: This page explains how to switch from a personal to a corporate account using the Scaleway console.
tags: change switch account personal corporate business account
dates:
validation: 2023-09-03
validation: 2024-03-12
posted: 2023-09-03
categories:
- console
---


Scaleway offers two profile types: Personal and Corporate. All users are given the possibility to select one or the other option when first signing up for a Scaleway account. If you signed up for a personal account and need to convert to a corporate one, follow these instructions.

Scaleway allows you to choose between two types of account: Personal and Corporate. All users are given the possibility to select one or the other option when first signing up for a Scaleway account. If you signed up for a personal account and need to convert to a corporate one, follow these instructions.

<Message type="important">
Switching to a corporate account is permanent. You will not be able to switch back to a personal account once the conversion to corporate is completed.
</Message>

<Macro id="requirements" />
- A Scaleway account logged into the [console](https://console.scaleway.com)

<Message type="requirement">
- You have a [Scaleway](https://www.scaleway.com/en/) account.
</Message>
1. From your [Organization dashboard](https://console.scaleway.com/organization), click [Billing](https://www.scaleway.com/en/docs/faq/billing) in the top right drop-down menu. The **Billing** dashboard displays.

2. Click the **Payment and billing tab**.

1. Log into the [Scaleway console](https://console.scaleway.com).
2. Navigate to the [Billing](https://www.scaleway.com/en/docs/faq/billing) tab of your Organization dashboard. Your billing information displays:
<Lightbox src="scaleway-billing-info.webp" alt="" />
3. Click <Icon name="edit" /> **Edit** to modify your account information. A pop-up displays with your personal information.
3. Scroll down to billing information, then click <Icon name="edit" /> **Edit**. A pop-up with your billing information displays.
<Lightbox src="scaleway-billing-personal-info.webp" alt="" />
4. Check the box at the top to confirm you wish to have a corporate account. A new form displays.
<Lightbox src="scaleway-billing-corporate-info.webp" alt="" />
5. Enter your company's information including a name, address and valid VAT number.
5. Enter your company's information, including name, address and valid VAT number.
<Message type="note">
European B2B customers are exempted from VAT, as long as they provide a registered VAT number. Learn more about our [tax policy](/faq/billing/#do-the-prices-shown-on-the-website-include-eu-vat).
</Message>
6. Click **Confirm changes** to effectively convert your account from personal to corporate.
6. Click **Confirm changes** to permanently convert your account from personal to corporate.


<Navigation title="See also">
Expand Down
2 changes: 1 addition & 1 deletion menu/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@
"slug": "test-a-function"
},
{
"label": "Package function dependencies in a zip-file",
"label": "Package function dependencies in a zip file",
"slug": "package-function-dependencies-in-zip"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,65 +7,72 @@ content:
paragraph: This page explains how to package your code and upload it as a zip to Serverless Functions Console
tags: functions zip-file
dates:
validation: 2023-08-28
validation: 2024-03-18
posted: 2021-05-26
categories:
- serverless
---

This page explains how to upload your functions and their dependencies as a ZIP file using the Scaleway console.
This feature can help you to add your libraries or static files to your function.
This page explains how to upload your functions and their dependencies as a zip file using the Scaleway console.
This feature allows you to add your libraries or static files to your function.

<Macro id="requirements" />

<Message type="requirement">
- You have an account and are logged into the [Scaleway console](https://console.scaleway.com)
- You have [created a functions namespace](/serverless/functions/how-to/create-a-functions-namespace/)
- You know how to [create a Function](/serverless/functions/how-to/create-a-function/)
</Message>

There are [different methods to deploy functions](/serverless/functions/reference-content/deploy-function/) and some of them require
the function to be packaged into a `zip` file.
- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- A [Functions namespace](/serverless/functions/how-to/create-a-functions-namespace/)

## How to package a function into zip file

There are [different methods to deploy functions](/serverless/functions/reference-content/deploy-function/) and some of them require the function to be packaged into a `zip` file.

To match the Scaleway build pipelines requirements, functions zip files must contain the content of the root folder you want to publish.

✅ Example of a good archive:
### Example of a good archive

The file containing the [handler](/serverless/functions/concepts/#handler) of the function is located at the root of the archive.

```
myFunc.zip contains:
myFunction.zip
└── handler.js
```

❌ Example of a bad archive:
### Example of a bad archive

The file containing the [handler](/serverless/functions/concepts/#handler) of the function is located in a folder, and not at the root of the archive.

```
myFunc.zip contains:
└── myFunc/ (a folder)
myFunction.zip
└── myFunction/
└── handler.js
```

### Creating a zip file

To create an archive of folder content, you can use the `zip` command:

```sh
zip -r handler.zip handler/
zip -r myFunction.zip myFunction/
```

To check if your archive is well-formed, ensure you have your function code as soon as you `unzip` it.


## How to upload your zip file to the Scaleway console

1. Package your dependencies on your local computer, as explained in the [Configure your package](/serverless/functions/how-to/package-function-dependencies-in-zip/#how-to-zip-your-function) section.
2. Create a **ZIP** archive containing the files and folders you need.
3. Go to the [Functions](https://console.scaleway.com/functions/namespaces) section of the Scaleway console and click on the function namespace you want to configure.
2. Create a **zip** archive containing the files and folders you need.
3. Go to the [Functions](https://console.scaleway.com/functions/namespaces) section of the Scaleway console and click on the functions namespace you want to use.
4. Click **+ Create function**. The function creation page displays.
5. On the function creation page, choose your desired runtime.
6. Select **Upload a ZIP** in **Function code**.
7. Drag and drop your ZIP file in the reserved field or upload it.
6. Select **Upload a ZIP** under **Function code**.
7. Drag and drop your zip file in the reserved field or upload it.
8. Specify your **handler** path.
9. Configure your function.
10. Click **Create function** to finish.

<Message type="note">
Refer to our [dedicated documentation](/serverless/functions/how-to/create-a-function/) for more information on how to create Serverless Functions
</Message>

## How to upload your zip file using the Scaleway API

Expand All @@ -76,7 +83,7 @@ To check if your archive is well-formed, ensure you have your function code as s

In this section, you will upload your code to a S3 bucket, which we will package and build into a container image. The created container image will then be available in a registry namespace associated to your functions namespace.

1. Set an environment variable to name the ZIP file automatically.
1. Set an environment variable to name the zip file automatically.
```bash
export FUNCTION_ARCHIVE="function-$SCW_FUNCTION_ID.zip"
```
Expand Down Expand Up @@ -199,15 +206,15 @@ In some specific cases, you might need to install libraries that require specifi
- psycopg2
and others.

Our Python runtimes run on top of [Alpine linux](https://alpinelinux.org/) environments, for these specific dependencies, you will have to install your dependencies inside a **Docker container**, with a specific image, that we are providing to our users.
Our Python runtimes run on top of [Alpine Linux](https://alpinelinux.org/) environments, for these specific dependencies, you will have to install your dependencies inside a **Docker container**, with a specific image, that we are providing to our users.
Run the following command from the root of your project to install your dependencies before uploading your source code and deploying your function:

```bash
PYTHON_VERSION=3.10 # or 3.7, 3.8, ...
docker run --rm -v $(pwd):/home/app/function --workdir /home/app/function rg.fr-par.scw.cloud/scwfunctionsruntimes-public/python-dep:$PYTHON_VERSION pip install -r requirements.txt --target ./package
```

This command will run `pip install` with the given `requirements.txt` file inside a docker container compatible with our function runtimes, and pull the installed dependencies locally to your package directory. As these dependencies have been installed on top of alpine Linux with our compatible system libraries, you will be able to upload your source code and deploy your function properly.
This command will run `pip install` with the given `requirements.txt` file inside a docker container compatible with our function runtimes, and pull the installed dependencies locally to your package directory. As these dependencies have been installed on top of Alpine Linux with our compatible system libraries, you will be able to upload your source code and deploy your function properly.

## How to configure your package using Node

Expand Down Expand Up @@ -269,7 +276,7 @@ If your handler is in a subdirectory, the handler name should be prefixed by the
```

2. Upload the archive in the console.
3. Provide a custom handler name. Each of your function will know which handler file to run:
3. Provide a custom handler name. Each of your functions will know which handler file to run:
- For the file `handler.go` at the root of the project → `Handle`.

<Message type="note">
Expand Down Expand Up @@ -358,12 +365,6 @@ Our runtimes automatically install your dependencies at **Build time** (once you
Dependencies installation at the build-time results in longer builds.
</Message>

<Navigation title="See also">
<PreviousButton to="/serverless/functions/how-to/create-a-function/">How to create a function</PreviousButton>
<NextButton to="/serverless/functions/how-to/manage-a-function/">How to manage a function</NextButton>
</Navigation>


## How to manage multiple handles in the same zip file

To enhance deployment simplicity, all runtimes support the inclusion of multiple handlers, either within a single file or across multiple files.
Expand All @@ -376,5 +377,9 @@ Example:
└── myFuncB.lang (contains handlerC())
```
Like that, you can create 3 functions with the same zip file by just changing the `handler` parameter
to match the handler you want.
This way, you can package 3 functions within the same zip file, and execute the desired one by changing the `handler` parameter to match the handler you want.
<Navigation title="See also">
<PreviousButton to="/serverless/functions/how-to/create-a-function/">How to create a function</PreviousButton>
<NextButton to="/serverless/functions/how-to/manage-a-function/">How to manage a function</NextButton>
</Navigation>
19 changes: 10 additions & 9 deletions storage/object/how-to/access-objects-via-https.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,33 @@ content:
paragraph: This page explains how to access objects via HTTPS.
tags: object storage object-storage download https
dates:
validation: 2023-09-05
validation: 2024-03-12
posted: 2023-09-05
categories:
- storage
- object-storage
---

<Macro id="requirements" />
Scaleway Object Storage allows you to access your objects via HTTPS.

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- An [Object Storage bucket](/storage/object/how-to/create-a-bucket/)
- An object whose [visibility](/storage/object/how-to/manage-object-visibility) is set to public
If an object is [private](/storage/object/how-to/manage-object-visibility/), you can create a temporary public link from the [Scaleway console](https://console.scaleway.com).

If an object is public, you can retreive the link to access it from the [Scaleway console](https://console.scaleway.com).

You can access your files via HTTPS by creating a public link from the Scaleway console.
<Macro id="requirements" />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Created an Object Storage bucket](/storage/object/how-to/create-a-bucket/) and have [uploaded objects](storage/object/how-to/upload-files-into-a-bucket) to it

1. Click **Object Storage** on the side menu. The list of your buckets displays.
2. Click the bucket that contains the file you want to access. A list of your objects displays.
3. Click <Icon name="more" /> next to the file you want to access.
4. Select **Get public link**.
5. Set an expiration date.
6. Click **Generate link**. Your temporary file public link displays.
6. Click **Generate link**. Your temporary public link displays.

<Message type="note">
To get a permanent link to an object, [change its visibility](/storage/object/how-to/manage-object-visibility/) to **public**.
To make the link to an object permanent, [change its visibility](/storage/object/how-to/manage-object-visibility/) to **public**. The link will work as long as the object is public.
</Message>


Expand Down

0 comments on commit b3702bc

Please sign in to comment.