Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property ACF::$fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields.php on line 138

Deprecated: Creation of dynamic property acf_loop::$loops is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 28

Deprecated: Creation of dynamic property ACF::$loop is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/loop.php on line 269

Deprecated: Creation of dynamic property ACF::$revisions is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/revisions.php on line 397

Deprecated: Creation of dynamic property acf_validation::$errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 28

Deprecated: Creation of dynamic property ACF::$validation is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/validation.php on line 214

Deprecated: Creation of dynamic property acf_form_customizer::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 28

Deprecated: Creation of dynamic property acf_form_customizer::$preview_fields is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 29

Deprecated: Creation of dynamic property acf_form_customizer::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-customizer.php on line 30

Deprecated: Creation of dynamic property ACF::$form_front is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-front.php on line 598

Deprecated: Creation of dynamic property acf_form_widget::$preview_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 34

Deprecated: Creation of dynamic property acf_form_widget::$preview_reference is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 35

Deprecated: Creation of dynamic property acf_form_widget::$preview_errors is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-widget.php on line 36

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the all-in-one-wp-migration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp_plugin/wp_plugin.php on line 23

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 54

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1539

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 828

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rocket domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131

Deprecated: Creation of dynamic property acf_field_oembed::$width is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 31

Deprecated: Creation of dynamic property acf_field_oembed::$height is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-oembed.php on line 32

Deprecated: Creation of dynamic property acf_field_google_map::$default_values is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-google-map.php on line 33

Deprecated: Creation of dynamic property acf_field__group::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-group.php on line 31

Deprecated: Creation of dynamic property acf_field_clone::$cloning is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 34

Deprecated: Creation of dynamic property acf_field_clone::$have_rows is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-clone.php on line 35

Deprecated: Creation of dynamic property jh_acf_field_table::$settings is deprecated in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-content/plugins/advanced-custom-fields-table-field/class-jh-acf-field-table.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php:6131) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":24901,"date":"2020-07-28T13:07:45","date_gmt":"2020-07-28T10:07:45","guid":{"rendered":"https:\/\/upcloud.com\/community\/tutorials\/object-storage-api"},"modified":"2020-07-28T13:07:45","modified_gmt":"2020-07-28T10:07:45","slug":"object-storage-api","status":"publish","type":"tutorial","link":"https:\/\/studiogo.tech\/upcloudold\/tutorial\/object-storage-api\/","title":{"rendered":"How to manage UpCloud Object Storage via API"},"content":{"rendered":"\n

If your project or application has the need to handle large amounts of unstructured data, you should make use of object storage. It\u2019s a computer data storage architecture that manages data as objects as opposed to block storage which manages data as blocks within sectors and tracks. As such, object storage is commonly used for storing large datasets like photos on Facebook, songs on Spotify, or files in online collaboration services.<\/p>\n\n\n\n

The security and redundancy ensured UpCloud Object Storage is the perfect place to store any data for your needs. Thanks to the S3-compatible and programmable interface, you have a host of options for existing tools and code implementations to make quick work of integrating Object Storage with your application.<\/p>\n\n\n\n

\n
Test hosting on UpCloud!<\/a><\/div>\n<\/div>\n\n\n\n

Using the UpCloud API<\/h2>\n\n\n\n

In this guide, we\u2019ll show you the available API requests<\/a> that can be used to create, manage and delete Object Storage devices as well as how to proceed after you\u2019ve created your first Object Storage.<\/p>\n\n\n\n

Note that accessing your UpCloud account via the API requires that you\u2019ve enabled API permissions. If you are not yet familiar with the UpCloud API, we would suggest taking a quick look at our guide to getting started with UpCloud API<\/a> to set up your API user account and access rights.<\/p>\n\n\n\n

Getting details on Object Storage<\/h2>\n\n\n\n

There are two simple API requests that can be used to query information about your Object Storage, a general list of all requests and a call to pull information about a specific Object Storage.<\/p>\n\n\n\n

Get all Object Storage<\/h3>\n\n\n\n

This request is used to list all Object Storage devices on the account or those for which the user has permission if using a subaccount. Use the following GET request to list your Object Storage services.<\/p>\n\n\n\n

Request<\/strong><\/p>\n\n\n\n

GET \/1.3\/object-storage\/\n<\/pre>\n\n\n\n

Response<\/strong><\/p>\n\n\n\n

HTTP\/1.0 200 OK\n<\/pre>\n\n\n\n
{\n  \"object_storages\": {\n    \"object_storage\": [\n      {\n        \"created\": \"2020-07-23T05:06:35Z\",\n        \"description\": \"Example object storage\",\n        \"name\": \"example-object-storage\",\n        \"size\": 500,\n        \"state\": \"started\",\n        \"url\": \"https:\/\/example-object-storage.nl-ams1.upcloudobjects.com\/\",\n        \"uuid\": \"06832a75-be7b-4d23-be05-130dc3dfd9e7\",\n        \"zone\": \"uk-lon1\"\n      }\n    ]\n  }\n}\n<\/pre>\n\n\n\n

Get Object Storage details<\/h3>\n\n\n\n

If you know the UUID of a specific Object Storage, you can get details about that Object Storage by adding the UUID to your API request URL as shown below.<\/p>\n\n\n\n

Request<\/strong><\/p>\n\n\n\n

GET \/1.3\/object-storage\/{uuid}\n<\/span><\/pre>\n\n\n\n

Response<\/strong><\/p>\n\n\n\n

HTTP\/1.0 201 OK\n<\/pre>\n\n\n\n
{\n  \"object_storage\": {\n     \"created\": \"2020-07-23T05:06:35Z\",\n     \"description\": \"Example object storage\",\n     \"name\": \"example-object-storage\",\n     \"size\": 500,\n     \"state\": \"started\",\n     \"url\": \"https:\/\/example-object-storage.nl-ams1.upcloudobjects.com\/\",\n     \"used_space\": 0,\n     \"uuid\": \"06832a75-be7b-4d23-be05-130dc3dfd9e7\",\n     \"zone\": \"uk-lon1\"\n  }\n}\n<\/pre>\n\n\n\n

Creating new Object Storage<\/h2>\n\n\n\n

You can create a new Object Storage device by using the following API request. You will need to define at least the location and storage size for your new Object Storage by setting the zone<\/tt> and size<\/tt> attributes. This can be done for example in JSON format in the API request body.<\/p>\n\n\n\n

You also need to set the access_key<\/tt> and secret_key<\/tt> which will be used to authenticate your access to the Object Storage when using an S3 client. These can be anything between 8 and 255 characters long.<\/p>\n\n\n\n

Additionally, you may differentiate your Object Storage by setting the name<\/tt> and description<\/tt> attributes as shown in the example below.<\/p>\n\n\n\n

Request<\/strong><\/p>\n\n\n\n

POST \/1.3\/object-storage\/\n<\/pre>\n\n\n\n

Body<\/strong><\/p>\n\n\n\n

{\n  \"object_storage\": {\n    \"name\": \"data-object-storage\"<\/span>,\n    \"description\": \"data-object-storage\"<\/span>,\n    \"zone\": \"nl-ams1\"<\/span>,\n    \"access_key\": \"JT9WE882AZ548P5F1OZ2\"<\/span>,\n    \"secret_key\": \"nYuuz2hp+T+T8OdnX8ZefKcN8+VpyoT23IDrVjzP\"<\/span>,\n    \"size\": 500<\/span>\n  }\n}<\/pre>\n\n\n\n

Response<\/strong><\/p>\n\n\n\n

On successful request, you\u2019ll get a response showing the details of your new Object Storage. The response will also include the url<\/tt> and uuid<\/tt> attributes which you\u2019ll need for accessing the storage or making changes to it via the API,<\/p>\n\n\n\n

HTTP\/1.0 201 OK\n<\/pre>\n\n\n\n
{\n   \"object_storage\": {\n      \"created\": \"2020-07-23T05:06:35Z\",\n      \"description\": \"data-object-storage\",\n      \"name\": \"data-object-storage\",\n      \"size\": 500,\n      \"state\": \"started\",\n      \"url\": \"https:\/\/data-object-storage.nl-ams1.upcloudobjects.com\/\",\n      \"used_space\": 0,\n      \"uuid\": \"06d42e69-b1c4-4543-8f9f-df5fc7712c04\",\n      \"zone\": \"nl-ams1\"\n   }\n}\n<\/pre>\n\n\n\n

Modifying Object Storage<\/h2>\n\n\n\n

It\u2019s also possible to make some changes to your Object Storage after creation. You have the possibility to change the following attributes.<\/p>\n\n\n\n

\n\n\n\n\n\n\n\n\n
Attribute<\/th>\nAccepted value<\/th>\nDescription<\/th>\n<\/tr>\n<\/thead>\n
description<\/td>\n1-255 characters<\/td>\nShort description for the Object Storage<\/td>\n<\/tr>\n
access_key<\/td>\n3-255 characters<\/td>\nAccess key used to identify user<\/td>\n<\/tr>\n
secret_key<\/td>\n8-255 characters<\/td>\nSecret key used to authenticate user<\/td>\n<\/tr>\n
size<\/td>\n250<\/em>, 500<\/em>, 1000<\/em><\/td>\nSize of Object Storage in gigabytes, can be increased but cannot be decreased<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n\n\n\n

Request<\/b><\/p>\n\n\n\n

Then used an API request like the example below. Replace the uuid<\/tt> with the unique identifier of the Object Storage you wish to modify.<\/p>\n\n\n\n

PATCH \/1.3\/object-storage\/{uuid}<\/span><\/pre>\n\n\n\n
{\n  \"object_storage\": {\n    \"description\": \"Example object storage\",\n    \"access_key\": \"JT9WE882AZ548P5F1OZ2\",\n    \"secret_key\": \"nYuuz2hp+T+T8OdnX8ZefKcN8+VpyoT23IDrVjzP\",\n    \"size\": 1000\n  }\n}<\/pre>\n\n\n\n

Normal response<\/b>
If the changes were successful, you\u2019ll get a response confirming the new details.<\/p>\n\n\n\n

HTTP\/1.0 200 OK<\/pre>\n\n\n\n
{\n  \"object_storage\": {\n     \"created\": \"2020-07-23T05:06:35Z\",\n     \"description\": \"Example object storage\",\n     \"name\": \"example-object-storage\",\n     \"size\": 1000,\n     \"state\": \"started\",\n     \"url\": \"https:\/\/example-object-storage.nl-ams1.upcloudobjects.com\/\",\n     \"used_space\": 0,\n     \"uuid\": \"06832a75-be7b-4d23-be05-130dc3dfd9e7\",\n     \"zone\": \"uk-lon1\"\n  }\n}<\/pre>\n\n\n\n

As mentioned, the Object Storage size can be scaled up with a simple API call which will then increase the allocated quota to the new requested amount. The operation may take a moment during which the Object Storage will be in maintenance mode as indicated by the state attribute.<\/p>\n\n\n\n

Note that the Object Storage size can only be increased, decreasing the storage size is not supported.<\/p>\n\n\n\n

Deleting Object Storage<\/h2>\n\n\n\n

Object Storage devices can be deleted using the following API request. Replace the uuid<\/tt> in the API request URL with the unique identifier of the Object Storage you wish to delete.<\/p>\n\n\n\n

Request<\/b><\/p>\n\n\n\n

DELETE \/1.3\/object-storage\/{uuid}<\/span><\/pre>\n\n\n\n

Normal response<\/b><\/p>\n\n\n\n

HTTP\/1.0 204 OK<\/pre>\n\n\n\n
\n

Note that deleting the storage will permanently delete any data on the device which cannot be reverted.<\/p>\n<\/blockquote>\n\n\n\n

S3 API Access details<\/h2>\n\n\n\n

UpCloud Object Storage is fully S3-compliant meaning any existing S3 client you prefer should be able to connect and access your Object Storage. To do so, you will need to configure your S3 client to be able to authenticate with the storage.<\/p>\n\n\n\n

Note that the access details for your Object Storage cannot be obtained after the Object Storage has been created. Make sure to store your access and secret keys safely.<\/p>\n\n\n\n

If you\u2019ve lost your access details, you can set new keys using the Modify Object Storage request as shown below.<\/p>\n\n\n\n

Request<\/strong><\/p>\n\n\n\n

PATCH \/1.3\/object-storage\/{uuid}<\/span><\/pre>\n\n\n\n
{\n  \"object_storage\": {\n    \"access_key\": \"JT9WE882AZ548P5F1OZ2\",\n    \"secret_key\": \"nYuuz2hp+T+T8OdnX8ZefKcN8+VpyoT23IDrVjzP\",\n  }\n}<\/pre>\n\n\n\n

Make note of your Object Storage\u2019s endpoint url<\/tt>, access_key<\/tt> and sercret_key<\/tt> which are needed to be able to connect using an S3 client.<\/p>\n\n\n\n

If you don\u2019t already have an S3 client you prefer, have a look at S3cmd. Check out the tutorial on how to use the S3cmd command-line tool<\/a> to manage your Object Storage and get started.<\/p>\n\n\n\n

File management clients<\/h2>\n\n\n\n

MSP360 Explorer<\/a> provides a user interface allowing you to access, move and manage files across your local storage and the cloud storage of your choice. Cloud file management software by MSP360\u2122 is available in two versions: Freeware and PRO which both include clients for Windows and macOS.<\/p>\n\n\n\n

\"CloudBerry<\/figure>\n\n\n\n

Cyberduck<\/a> is a libre server and cloud storage browser for macOS and Windows with support for S3-compliant object storage in addition to FTP, SFTP, Dropbox, Google Drive and more. Cyberduck is funded through donations but the software itself is free to download and use.<\/p>\n\n\n\n

\"Cyberduck<\/figure>\n\n\n\n

Command line tools<\/h2>\n\n\n\n

S3cmd<\/a> is a free open-source<\/a> command-line tool and client for uploading, retrieving and managing data for any cloud storage service providers that use the S3 protocol and works great with UpCloud Object Storage. It is best suited for power users who are familiar with command-line programs but is simple enough for beginners to learn quickly as well. It is also ideal for batch scripts and automated backup to S3, for example, by scheduling using cronjobs.<\/p>\n\n\n\n

Check out our guide on S3cmd<\/a> and get started managing your Object Storage tasks.<\/p>\n\n\n\n

MinIO Client<\/a> provides a modern alternative to UNIX commands like ls, cat, cp, mirror, diff, find etc. It supports filesystems and S3-compatible cloud storage services across the board. In addition to being available for download on Windows, macOS and Linux, MinIO is also available as a docker image.<\/p>\n","protected":false},"featured_media":16934,"comment_status":"open","ping_status":"closed","template":"","community-category":[109,122,127,128],"class_list":["post-24901","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","community-category-upcloud-services","community-category-api","community-category-managed-services","community-category-object-storage"],"acf":[],"_links":{"self":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial\/24901","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/types\/tutorial"}],"replies":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/comments?post=24901"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media\/16934"}],"wp:attachment":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media?parent=24901"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/community-category?post=24901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}