Skip to main content

scaleway python client to interact with the scaleway API

Project description

Scaleway Python Client

prerequisites :

Set the environment variables SCW_API_KEY_ID & SCW_API_KEY.

Rdb :

  • list_instances
  • create_database
  • create_user
  • set_user_privileges
  • update_user
  • delete_user
  • delete_database
from scw_py_client.models.rdb import Privileges, User, Database
from scw_py_client.core import RdbClient

rdbClient = RdbClient()

instances = rdbClient.list_instances()
instance = instances[0]

test_database = rdbClient.create_database(instance=instance, database=Database(name="test_database"))
test_user = rdbClient.create_user(
    instance=instance, user=User(name="test_user"), password=User.Password("password1"))
rdbClient.set_user_privileges(instance=instance, privileges=Privileges(
    database_name=test_database.name, user_name=test_user.name, permission=Privileges.Permission.ReadWrite))
test_user = rdbClient.update_user(instance=instance, user=test_user, password=User.Password("password2"))
rdbClient.delete_user(instance=instances[0], user=test_user)
rdbClient.delete_database(instance=instance, database=test_database)

Registry :

  • list_images
  • get_image
  • update_image
  • delete_image
from scw_py_client.core import RegistryClient

registryClient = RegistryClient()
images = registryClient.list_images()

Functions :

  • list_containers
  • get_container
  • create_container
  • deploy_container
  • update_container
  • delete_container
  • list_namespaces
  • get_namespace
  • create_namespace
  • update_namespace
  • delete_namespace
  • list_functions
  • get_function
  • create_function
  • deploy_function
  • update_function
  • delete_function
  • list_crons
  • get_cron
  • create_cron
  • update_cron
  • delete_cron
  • list_logs
from scw_py_client.core import FunctionsClient

functions_client = FunctionsClient()
containers = functions.list_containers()

Object Storage :

  • list_buckets
  • create_bucket
  • enable_bucket_website
  • upload_file_to_bucket
from scw_py_client.core import ObjectStorageClient

object_storage_client = ObjectStorageClient.ObjectStorage()
buckets = object_storage_client.list_buckets()
object_storage_client.create_bucket("my_bucket_name")

K8s :

  • list_clusters
from src.scw_py_client.core import K8sClient

k8s_client = K8sClient()
clusters = k8s_client.list_clusters()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scw-py-client-0.1.2.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scw_py_client-0.1.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file scw-py-client-0.1.2.tar.gz.

File metadata

  • Download URL: scw-py-client-0.1.2.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.0

File hashes

Hashes for scw-py-client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 986768648a6cbd78f8f0b43092061d908ab766b5842fdb32ec87a88afb0bdb46
MD5 66dd8edb05b21738541b91ffb03fbf5f
BLAKE2b-256 7208d3d929b501b35b92c5edd4f524c8ddec5397138abd3339bf21315ff5bab3

See more details on using hashes here.

File details

Details for the file scw_py_client-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: scw_py_client-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.0

File hashes

Hashes for scw_py_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 287eb9ba71a7a5d62c7c95fecaa82991e0d82a47a93a95ae0953b0498766f148
MD5 5eb4127581f9ea3ebd9af7aa6932c262
BLAKE2b-256 e69158a270a11045c89e5200bebf0eb031da4104fb0afdc649c197095c41b976

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page