VPC API

Introduction: Projects, Resources, and Quotas

The most basic element in the Virtual Private Cloud is the project. Projects are the combination of all objects available to the user: virtual machines, disks, networks, etc. Within the framework of a project, users can reserve and distribute resources (RAM, vCPUs, disk space, etc.) among their objects.

When a project is created, the user adds a specific number of resources to the project. This creates a limit, or quota, of resources available for that project.

Projects are created in specific geographic locations known as regions. Two regions are available: St. Petersburg and Moscow. Regions are made up of zones. In the context of our service, zones represent the data centers in a given region. St. Petersburg has two zones (ru-1a and ru-1b) and Moscow has one (ru-2a).

In addition to the control panel, VPC projects, resources, and objects can be managed from an API using standard HTTP requests. To send requests to the API, the user should choose the appropriate method from the documentation, formulate the request according to the description, and then execute it. API responses are returned in JSON format.

The structure of typical requests (e.g. creating projects, assigning quotas, and adding users) and their responses are described below. The full documentation is available in our control panel.

Getting Started: Obtaining a Key

To use the API, you will first need an authentication key (token). Users registered at Selectel can obtain a key on the page my.selectel.ru/profile/apikeys. A token is a single string like qX3Npu42ua73kPkhe4QCQ8Vv9_xxxxx, where xxxxx is the user's account number.

Each IP address is listed with the status DOWN, but this doesn't imply any error, only that the address hasn't been attached to a machine. Like all VPC objects, every IP address has an ID.

This parameter will also be needed later on when we create virtual machines and assign them addresses.

Users and Roles

Projects can be accessible to multiple users. This is done by first creating a new user and then adding them to the project.

Users added to a project have a limited number of permissions in the project, or "role" in OpenStack terminology. Roles are required for working with third-party programs, such as the ones described in the Console Clients section of our knowledge base.

To create a new user, we send a POST request with the user's login and password: