Представляем спецификацию OpenAPI DigitalOcean



Когда v2 нашего API впервые стала общедоступной в апреле 2015 года, она в основном состояла из функций, поддерживающих дроплеты и домены. С тех пор портфель продуктов DigitalOcean расширился, и вместе с ним значительно расширилась и площадь нашего API. Сегодня наш API поддерживает платформу приложений, базы данных, брандмауэры, Kubernetes, балансировщики нагрузки и многое другое. Предоставляя более 200 операций, наш API позволяет вам делать практически все, что вы можете делать в нашей панели управления программно.

Не отставать от всех этих изменений может быть непросто. Вот почему мы рады объявить о выпуске нового инструмента, который придаст вам уверенности при разработке с использованием нашего API: спецификации DigitalOcean OpenAPI.

Что такое OpenAPI?
OpenAPI — это открытый стандарт для описания API под эгидой OpenAPI Initiative. Сама спецификация гласит:
  • Спецификация OpenAPI (OAS) определяет стандартный, не зависящий от языка интерфейс для RESTful API, который позволяет людям и компьютерам обнаруживать и понимать возможности службы без доступа к исходному коду, документации или через проверку сетевого трафика. При правильном определении потребитель может понимать удаленную службу и взаимодействовать с ней с минимальным объемом логики реализации.
  • Затем определение OpenAPI может использоваться инструментами создания документации для отображения API, инструментами генерации кода для генерации серверов и клиентов на различных языках программирования, инструментами тестирования и многими другими вариантами использования.
На внутреннем уровне спецификация OpenAPI предоставляет инженерам DigitalOcean общий язык для определения и совместной работы над проектированием API. Он также определяет формальный контракт, который можно тестировать и отслеживать, чтобы гарантировать стабильность нашего API. Публично публикуя спецификацию, она предоставляет клиентам новые способы взаимодействия с нашим API.
www.openapis.org/
spec.openapis.org/oas/v3.0.3#introduction

Открытый источник
Исходные файлы для нашей спецификации теперь доступны на GitHub. Репозиторий также включает инструменты для работы с файлами. Например, чтобы проверить репозиторий и скомпилировать спецификацию в один файл, запустите:
github.com/digitalocean/openapi
git clone https://github.com/digitalocean/openapi.git

cd openapi/

make bundle


https://www.digitalocean.com

Sunsetting DigitalOcean’s API v1

Since releasing version 2 of our API nearly a year ago and officially bringing it out of beta last month, we’ve seen a tremendous uptake of usage by our community. As the ecosystem of tools and libraries continues to grow, we’ve decided that it is time to sunset version 1 of the API.

Don’t worry! We’re not going to pull the rug out from under you. In order to give everyone time to port their tools, version 1 will not be turned off until November 1st 2015

With its (more) RESTful interface and features like OAuth support, v2 is both powerful and easy to use. Our developer documentation should give you all the information you need to begin the transition. If you have questions, you can always ask on our Community site or on Twitter.

API v2 is now out of beta



We are very pleased to announce that API v2 is coming out of beta, nine months after its initial release. With this release we wanted to introduce new features not available in v1, while maintaining the level of simplicity developers loved in our first version. To help us keep it simple and stomp out bugs, we called on the community to collaborate with us in a public GitHub repository. The last nine months of collaboration with the community ensured our API remained awesome as we added these new features.

Our previous API was simple and easy to use. However, it lacked features allowing developers to interact with DigitalOcean in more advanced ways. We knew we wanted to include new features like:
  • OAuth
  • Pagination
  • A (more) RESTful interface
We wanted to add all of these features in v2, but were wary of increasing the complexity for our community. So, our first tactic was to introduce only new features the community was actually requesting. This involved taking internal and customer feedback even before launching in beta through UserVoice, internal dogfooding, and support tickets. Then during the beta, we received a constant stream of new feedback via the public GitHub repo.

Close collaboration with the community allowed us to fix several bugs as well as add a couple of very useful features. We received a high amount of feedback about the images endpoint, for example — specifically around filtering and maintaining an acceptable level of response time. Many of our users have a large number of snapshots and backups, so the ability to request different types of images via this endpoint proved very useful. Some other features which made it in thanks to community feedback include:
  • Increasing the base rate limit
  • Adding more information to the user endpoint
  • Clarifying the API documentation
  • Adding stronger validations to the Droplet creation process

Our second tactic was to keep the API as consistent as possible to reduce the cognitive load on the developer. As an example, we made sure all region objects in JSON responses follow the same format.

The final tactic was to beef up our API docs by launching our new developer portal. The new portal provides clear documentation, links to community tutorials to get started, and a centralized repository of API libraries.
We would like to thank everyone who helped report bugs and suggest features during the beta period. Thanks to you, API v2 is finally launched! Try it out here.

Easily Automate The Provisioning Of Your DigitalOcean Droplets!



www.digitalocean.com/company/blog/easily-automate-the-provisioning-of-your-droplets/

What kind of information is available via metadata?
Examples of available Droplet metadata include Droplet ID, data center region, IP addresses, and user-data.

What is user-data?
User-data is a special piece of metadata that can be provided by the user during the Droplet creation process. This data can be consumed by CloudInit to configure a server.

Which regions support metadata?
At launch, the SGP1, SFO1, LON1, AMS2, AMS3, & NYC3 regions have metadata available.

What is CloudInit?
CloudInit is a process enabled on recent DigitalOcean images that is able to pull down and process information from metadata. When the Droplet boots for the first time, the CloudInit program executes the script it finds in the “user-data” field, providing users the opportunity to automate the initial configuration of their servers.

Which images can process metadata information with CloudInit?
Currently, Ubuntu 14.04 and CentOS 7 base images have CloudInit enabled. Any one-click apps based on these releases will also have this functionality available. CoreOS servers also process the “user-data” field using a different mechanism.

Where can I learn more about using metadata and CloudInit?
We have prepared community articles that cover using the metadata service and writing scripts for CloudConfig. Also, our developer portal contains full documentation of the Metadata API.