All Projects → 152percent → DigitalOcean-SDK

152percent / DigitalOcean-SDK

Licence: MIT license
A Digital Ocean SDK for iOS and OSX -- Unit tests pass locally!

Programming Languages

objective c
16641 projects - #2 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to DigitalOcean-SDK

offensive-docker-vps
Create a VPS on Google Cloud Platform or Digital Ocean easily with Offensive Docker included to launch assessment to the targets.
Stars: ✭ 66 (+407.69%)
Mutual labels:  digital-ocean
data-processing-pipeline
Real-Time Data Processing Pipeline & Visualization with Docker, Spark, Kafka and Cassandra
Stars: ✭ 79 (+507.69%)
Mutual labels:  digital-ocean
vps
A laravel 5 package to easily create and maintain vps on digital ocean
Stars: ✭ 59 (+353.85%)
Mutual labels:  digital-ocean
doclt
Digital Ocean Command Line Tool
Stars: ✭ 43 (+230.77%)
Mutual labels:  digital-ocean
GameHer
Gameher is a French association aspiring to develop gender diversity in the fields of video games, esport and streaming. We want to give players the tools they need to flourish and evolve in the fields of video games, esport and streaming.
Stars: ✭ 35 (+169.23%)
Mutual labels:  digital-ocean
digital-ocean
Idiomatic Clojure client for Digital Ocean that makes it easy to boot virtual servers from your REPL
Stars: ✭ 34 (+161.54%)
Mutual labels:  digital-ocean
metadata-one-liners
retrive metadata endpoint data with these one liners.
Stars: ✭ 38 (+192.31%)
Mutual labels:  digital-ocean
CodingWithMitch-Blog-Course
Web development with Django (Python) for Beginners
Stars: ✭ 148 (+1038.46%)
Mutual labels:  digital-ocean
DigitalOceanApp
Admin Console for Digital Ocean
Stars: ✭ 55 (+323.08%)
Mutual labels:  digital-ocean
next
(Work in progress) The rewritten version of the original PizzaQL 🍕
Stars: ✭ 45 (+246.15%)
Mutual labels:  digital-ocean
DigitalOceanFlask
installing a Flask webapp on a Digital Ocean (or Linode, etc.) Ubuntu box
Stars: ✭ 42 (+223.08%)
Mutual labels:  digital-ocean
dots
digital ocean api typescript/javascript wrapper
Stars: ✭ 65 (+400%)
Mutual labels:  digital-ocean
digitalocean
Scala wrapper around Digital Ocean's API, version 2
Stars: ✭ 28 (+115.38%)
Mutual labels:  digital-ocean
Hacktoberfest-2k19
A Repository for Micro Club members dedicated for Hacktoberfest 6th edition (2k19). The purpose of this repo is getting MC members into the open source community and help them develop and share projects and knowledge with other students, profesionals and open source enthousiasts while having a fun challenge !!
Stars: ✭ 16 (+23.08%)
Mutual labels:  digital-ocean
tls certificate generation
Use temporary Amazon EC2 / Digital Ocean cloud machines to get / renew letsencrypt certificates
Stars: ✭ 28 (+115.38%)
Mutual labels:  digital-ocean
darknode-cli
Tool for deploying and managing Darknodes
Stars: ✭ 54 (+315.38%)
Mutual labels:  digital-ocean

DigitalOcean iOS SDK (Unofficial)

CI Status Version License Platform

Disclaimer

This SDK is in no way affiliated with Digital Ocean, or their any of their development efforts.

Although the SDK has been built specifically to work with Digital Ocean's public API, it has not been endorsed nor is it supported by Digital Ocean.

I built this for my own purposes almost 3 years ago and am open sourcing it now, but have no plans to continue supporting or developing it.

It is currently in use in production apps, and has many unit tests to keep it stable. It is considered a v1.0 so please feel free to use it in your own apps.

Platforms

This SDK is compatible with the following platforms & versions:

  • iOS 7.0+
  • OSX 10.9+

Examples

Services & Queries

The SDK uses simple patterns -- paired with an object oriented design -- for integrating with the public Digital Ocean API.

In order to access an endpoint, the SDK provides access to various Queries. A query can then be processed through a Service.

  • DOService
  • DOQuery

Its recommended you create a single service, and reuse it throughout your applications lifecycle. However, its not enforced and you can choose to create multiple services if you prefer.

This is useful when you want to access multple accounts at the same time.

Authentication

In order to perform a query however, we need to pass a authToken. You can either generate a token through the Digital Ocean API section of their website, or use the SDK to perform login for you.

DOAuthenticationController *controller = [[DOAuthenticationController alloc] initWithDelegate:self clientID:$CLIENT_ID clientSecret:$CLIENT_SECRET redirectURI:$REDIRECT_URI];
  [self presentViewController:controller animated:YES completion:nil];

To get started you need to configure an instance of the service:

// Creates a new authenticated service
DOService *service = [DOService serviceWithToken:$TOKEN delegate:nil]];

// This method is called when authentication is successful
- (void)authenticationController:(DOAuthenticationController *)controller didAuthenticateWithUser:(DOUser *)user;

Passing nil for the delegate, forces the SDK to use a default NSURLSession for all networking. You can optionally provide your own delegate to override this behaviour.

Note: Requests will still be generated automatically, including authentication headers.

Queries

The Digital Ocean SDK uses DOQuery objects to query the API and perform any associated actions. These queries are separated into various objects for fetch, insert, delete, update, and other actions.

So, if you wanted to fetch all Droplets associated with your account you would call the following code:

DOQuery *query = [DOQuery fetchDroplets];
[service performQuery:query completion:^(NSArray *results, DOMetaData *meta, NSError *error) {
  NSLog(@"%@", results);
}];

Instead of the original NSData and NSURLResponse being returned, we now have an object representation of the response. results will contain an array of DODroplet instances. meta will contain various information such as rate-limit info, pagination, etc... error will contain any associated errors -- note: an error will always be returned when necessary, even if the associated response didn't return one -- this is for consistency

Queries

Actions

+ (instancetype)softPowerOffDropletWithID:(NSUInteger)dropletID;
+ (instancetype)hardPowerOffDropletWithID:(NSUInteger)dropletID;
+ (instancetype)softRebootDropletWithID:(NSUInteger)dropletID;
+ (instancetype)hardRebootDropletWithID:(NSUInteger)dropletID;
+ (instancetype)powerOnDropletWithID:(NSUInteger)dropletID;
+ (instancetype)upgradeDropletWithID:(NSUInteger)dropletID;
+ (instancetype)resizeDropletWithID:(NSUInteger)dropletID toSizeSlug:(NSString *)sizeSlug increaseDiskPermanently:(BOOL)disk;
+ (instancetype)rebuildDropletWithID:(NSUInteger)dropletID withImageWithID:(NSUInteger)imageID;
+ (instancetype)resetPasswordForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)renameDropletWithID:(NSUInteger)dropletID name:(NSString *)name;
+ (instancetype)updateKernelForDropletWithID:(NSUInteger)dropletID kernelID:(NSUInteger)kernelID;
+ (instancetype)enableBackupsForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)disableBackupsForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)restoreBackupForDropletWithID:(NSUInteger)dropletID imageID:(NSUInteger)imageID;
+ (instancetype)enableIPV6ForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)enablePrivateNetworkingForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)createSnapshotForDropletWithID:(NSUInteger)dropletID name:(NSString *)name;
+ (instancetype)convertBackupToSnapshotForImageWithID:(NSUInteger)imageID;
+ (instancetype)transferImageWithID:(NSUInteger)imageID toRegionSlug:(NSString *)regionSlug;
+ (instancetype)assignFloatingIP:(NSString *)IPAddress toDropletWithID:(NSUInteger)dropletID;
+ (instancetype)unAssignFloatingIP:(NSString *)IPAddress;
+ (instancetype)reserveFloatingIPForRegionSlug:(NSString *)regionSlug;

Fetches

+ (instancetype)fetchAccount;
+ (instancetype)fetchRegions;
+ (instancetype)fetchSizes;
+ (instancetype)fetchScheduledUpgrades;
+ (instancetype)fetchNeighbors;
+ (instancetype)fetchNeighborsForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)fetchKernelsForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)fetchActions;
+ (instancetype)fetchActionsForDropletWithID:(NSUInteger)dropletID;
+ (instancetype)fetchActionsForImageWithID:(NSUInteger)imageID;
+ (instancetype)fetchActionWithID:(NSUInteger)actionID;
+ (instancetype)fetchDroplets;
+ (instancetype)fetchDropletWithID:(NSUInteger)dropletID;
+ (instancetype)fetchImages;
+ (instancetype)fetchImagesOfType:(DOImageFetchType)type;
+ (instancetype)fetchImageWithID:(NSUInteger)imageID;
+ (instancetype)fetchDomains;
+ (instancetype)fetchDomainNamed:(NSString *)name;
+ (instancetype)fetchRecordsForDomainNamed:(NSString *)name;
+ (instancetype)fetchRecordForDomainNamed:(NSString *)name recordID:(NSUInteger)recordID;
+ (instancetype)fetchSSHKeys;
+ (instancetype)fetchSSHKeyWithID:(NSUInteger)SSHKeyID;
+ (instancetype)fetchSSHKeyWithFingerprint:(NSString *)fingerprint;
+ (instancetype)fetchFloatingIPs;
+ (instancetype)fetchFloatingIP:(NSString *)IPAddress;

Inserts

+ (instancetype)insertDropletWithConfiguration:(void (^)(DODropletConfiguration * __configuration))configurationBlock;
+ (instancetype)insertDomainNamed:(NSString *)name ipAddress:(NSString *)ipAddress;
+ (instancetype)insertRecordForDomainNamed:(NSString *)name attributes:(NSDictionary *)attributes;
+ (instancetype)insertSSHKeyNamed:(NSString *)name publicKey:(NSString *)publicKey;
+ (instancetype)insertFloatingIPWithDropletID:(NSUInteger)dropletID;
+ (instancetype)insertFloatingIPWithRegionSlug:(NSString *)regionSlug;

Updates

+ (instancetype)updateRecordForDomainNamed:(NSString *)name recordID:(NSUInteger)recordID attributes:(NSDictionary *)attributes;
+ (instancetype)updateImageWithID:(NSUInteger)imageID withName:(NSString *)name;
+ (instancetype)updateSSHKeyWithID:(NSUInteger)SSHKeyID withName:(NSString *)name;
+ (instancetype)updateSSHKeyWithFingerprint:(NSString *)fingerprint withName:(NSString *)name;

Deletes

+ (instancetype)deleteDropletWithID:(NSUInteger)dropletID;
+ (instancetype)deleteImageWithID:(NSUInteger)imageID;
+ (instancetype)deleteDomainNamed:(NSString *)name;
+ (instancetype)deleteRecordForDomainNamed:(NSString *)name recordID:(NSUInteger)recordID;
+ (instancetype)deleteSSHKeyWithID:(NSUInteger)SSHKeyID;
+ (instancetype)deleteSSHKeyWithFingerprint:(NSString *)fingerprint;
+ (instancetype)deleteFloatingIP:(NSString *)IPAddress;

Documentation

For further documentation you can refer to the Header documentation as well as the included unit tests and example projects.

Installation

DigitalOcean is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DigitalOcean-SDK"

Author

Shaps @shaps

License

DigitalOcean is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].