scaleway_core.profile package

Submodules

scaleway_core.profile.env module

scaleway_core.profile.file module

scaleway_core.profile.profile module

class scaleway_core.profile.profile.Profile(access_key: 'Optional[str]' = None, secret_key: 'Optional[str]' = None, api_url: 'str' = 'https://api.scaleway.com', api_allow_insecure: 'bool' = False, user_agent: 'str' = 'scaleway-sdk-python/2.0.0', default_organization_id: 'Optional[str]' = None, default_project_id: 'Optional[str]' = None, default_region: 'Optional[str]' = None, default_zone: 'Optional[str]' = None, default_page_size: 'Optional[int]' = None)

Bases: ProfileDefaults, ProfileConfig

classmethod from_config_file(filepath: Optional[str] = None, profile_name: Optional[str] = 'default', force_none: bool = False) ProfileSelf
classmethod from_config_file_and_env(filepath: Optional[str] = None, profile_name: Optional[str] = 'default') ProfileSelf

Loads profile from a config file and environment variables.

Environment variables override config file.
  • If config file is not found, the profile is still loaded from environment variables.

  • If you want it to throw an error in case of missing or invalid config file, use Profile.from_config_file and Profile.from_env instead.

classmethod from_env(force_none: bool = False) ProfileSelf

Loads profile from environment variables.

classmethod get_default_config_directory() str
classmethod get_default_config_file_path(filepath: Optional[str] = None) str
merge(other: Profile) None

Merge the current profile with another one.

class scaleway_core.profile.profile.ProfileConfig(access_key: 'Optional[str]' = None, secret_key: 'Optional[str]' = None, api_url: 'str' = 'https://api.scaleway.com', api_allow_insecure: 'bool' = False, user_agent: 'str' = 'scaleway-sdk-python/2.0.0')

Bases: object

access_key: Optional[str] = None

You need an access key and a secret key to connect to Scaleway API. Generate your access key at the following address: https://console.scaleway.com/project/credentials.

api_allow_insecure: bool = False

Allow insecure connection to the API.

api_url: str = 'https://api.scaleway.com'

The Scaleway API URL. Change that if you want to direct requests to a different endpoint.

secret_key: Optional[str] = None

The secret key is the value that can be used to authenticate against the API (the value used in X-Auth-Token HTTP-header). The secret key MUST remain secret and not given to anyone or published online. Generate your secret key at the following address: https://console.scaleway.com/project/credentials.

user_agent: str = 'scaleway-sdk-python/2.0.0'

The User-Agent sent with each request.

class scaleway_core.profile.profile.ProfileDefaults(default_organization_id: 'Optional[str]' = None, default_project_id: 'Optional[str]' = None, default_region: 'Optional[str]' = None, default_zone: 'Optional[str]' = None, default_page_size: 'Optional[int]' = None)

Bases: object

default_organization_id: Optional[str] = None

Your organization ID is the identifier of your account inside Scaleway infrastructure.

default_page_size: Optional[int] = None

The default number of results when requesting a paginated resource.

default_project_id: Optional[str] = None

Your project ID is the identifier of the project your resources are attached to.

default_region: Optional[str] = None

A region is represented as a geographical area such as France (Paris) or the Netherlands (Amsterdam). It can contain multiple availability zones.

Examples: fr-par, nl-ams.

default_zone: Optional[str] = None

A region can be split into many availability zones (AZ). Latency between multiple AZ of the same region are low as they have a common network layer.

Examples: fr-par-1, nl-ams-1

Module contents

class scaleway_core.profile.Profile(access_key: 'Optional[str]' = None, secret_key: 'Optional[str]' = None, api_url: 'str' = 'https://api.scaleway.com', api_allow_insecure: 'bool' = False, user_agent: 'str' = 'scaleway-sdk-python/2.0.0', default_organization_id: 'Optional[str]' = None, default_project_id: 'Optional[str]' = None, default_region: 'Optional[str]' = None, default_zone: 'Optional[str]' = None, default_page_size: 'Optional[int]' = None)

Bases: ProfileDefaults, ProfileConfig

classmethod from_config_file(filepath: Optional[str] = None, profile_name: Optional[str] = 'default', force_none: bool = False) ProfileSelf
classmethod from_config_file_and_env(filepath: Optional[str] = None, profile_name: Optional[str] = 'default') ProfileSelf

Loads profile from a config file and environment variables.

Environment variables override config file.
  • If config file is not found, the profile is still loaded from environment variables.

  • If you want it to throw an error in case of missing or invalid config file, use Profile.from_config_file and Profile.from_env instead.

classmethod from_env(force_none: bool = False) ProfileSelf

Loads profile from environment variables.

classmethod get_default_config_directory() str
classmethod get_default_config_file_path(filepath: Optional[str] = None) str
merge(other: Profile) None

Merge the current profile with another one.

class scaleway_core.profile.ProfileConfig(access_key: 'Optional[str]' = None, secret_key: 'Optional[str]' = None, api_url: 'str' = 'https://api.scaleway.com', api_allow_insecure: 'bool' = False, user_agent: 'str' = 'scaleway-sdk-python/2.0.0')

Bases: object

access_key: Optional[str] = None

You need an access key and a secret key to connect to Scaleway API. Generate your access key at the following address: https://console.scaleway.com/project/credentials.

api_allow_insecure: bool = False

Allow insecure connection to the API.

api_url: str = 'https://api.scaleway.com'

The Scaleway API URL. Change that if you want to direct requests to a different endpoint.

secret_key: Optional[str] = None

The secret key is the value that can be used to authenticate against the API (the value used in X-Auth-Token HTTP-header). The secret key MUST remain secret and not given to anyone or published online. Generate your secret key at the following address: https://console.scaleway.com/project/credentials.

user_agent: str = 'scaleway-sdk-python/2.0.0'

The User-Agent sent with each request.

class scaleway_core.profile.ProfileDefaults(default_organization_id: 'Optional[str]' = None, default_project_id: 'Optional[str]' = None, default_region: 'Optional[str]' = None, default_zone: 'Optional[str]' = None, default_page_size: 'Optional[int]' = None)

Bases: object

default_organization_id: Optional[str] = None

Your organization ID is the identifier of your account inside Scaleway infrastructure.

default_page_size: Optional[int] = None

The default number of results when requesting a paginated resource.

default_project_id: Optional[str] = None

Your project ID is the identifier of the project your resources are attached to.

default_region: Optional[str] = None

A region is represented as a geographical area such as France (Paris) or the Netherlands (Amsterdam). It can contain multiple availability zones.

Examples: fr-par, nl-ams.

default_zone: Optional[str] = None

A region can be split into many availability zones (AZ). Latency between multiple AZ of the same region are low as they have a common network layer.

Examples: fr-par-1, nl-ams-1