Creating an Object Storage Instance using the API

To set up an object storage instance, you'll need an UpCloud user account that has API credentials. Instructions for creating a user account with API credentials can be found in the link below: https://upcloud.com/resources/tutorials/getting-started-upcloud-api

You’ll also need an API client. For this guide, we'll be using an API client called Insomnia. However, feel free to use any API client that you're comfortable with.

To get started, make the following API request, replacing {your-api-username} with your API username.

**POST** <https://api.upcloud.com/1.3/object-storage-2>

{
	"region": "europe-1",
	"configured_status": "started",
	"networks": [
		{
			"name": "pub",
			"type": "public",
			"family": "IPv4"
		}
	],
	"users": [
		{
			"username": "{your-api-username}"
		}
	]
}

Untitled

The output on the left confirms that the request was successful and that the object storage is now set up. From this output, you will need to note down two key details:

  1. The object storage uuid
  2. The domain name for the object storage endpoint

You will need these later.

In the example above, the uuid is 129c9eb1-9927-44cf-a4d1-fd8c78826556, and the endpoint domain is jifb2.upcloudobjects.com.

While setting up your object storage, its worth noting that using a private network for internal use is advisable where possible as it does not count towards the network transfer pool (NTP). This is more efficient and cost-effective when transferring data within resources in the same region, such as from a compute cluster to your object storage instance. Access rules to the object storage remain the same regardless of the network origin of the request.

Creating access keys using API

In order to access the newly created object storage instance, we first need to create access keys (credentials) for it. This is done using the API request below: