# ClcClient ClcClient is a ruby gem for CenturyLink Cloud's API V2.0. Full documentation on the API can be found on [CenturyLink Cloud's Website](http://www.centurylinkcloud.com/api-docs/v2/). ## Installation Add this line to your application's Gemfile: ```ruby gem `clc_client` ``` And then execute: $ bundle Or install it yourself as: $ gem install clc_client ## Usage To start using the login you must have a token. If you already have one you may simply set your token using `setToken(token)`. Otherwise you may use `login(username, password)` to generate one for you. Each call will return JSON that contains information returned by the API. Any call that has something like `variable = {}` will take in a JSON payload as a parameter. Be sure to have your JSON payloads set up correctly. All of the required and optional parameters including JSON payloads can be found in [Centurylink Cloud's documentation](http://www.centurylinkcloud.com/api-docs/v2/). ## Anti-Affinity Policies * `createAntiAffinityPolicy(accountAlias)` * `deleteAntiAffinityPolicy(accountAlias, policyId, payload = {})` * `getAntiAffinityPolicy(accountAlias, policyId)` * `getAntiAffinityPolicies(accountAlias)` * `updateAntiAffinityPolicy(accountAlias, policyId, name)` ## Authentication These do not return JSON, instead they return your token as a string. * `setToken(token)` * `login(username, name)` ## CustomFields * `getCustomFields(accountAlias)` ## DataCenters * `getDataCenter(accountAlias, dataCenter)` * `getDataCenterDeploymentCapabilities(accountAlias, datacenter)` * `getDataCenterList(accountAlias)` ## Groups * `createGroup(accountAlias, payload)` * `deleteGroup(accountAlias, groupId)` * `getGroup(accountAlias, groupId)` * `getGroupBillingDetails(accountAlias, groupId)` * `getGroupMonitoringStatistics(accountAlias, groupId)` * `setCustomGroupCustomFields(accountAlias, groupId, patchOperation = {})` * `setGroupNameOrDescription(accountAlias, groupId, patchOperation = {})` * `setGroupParent(accountAlias, groupId, patchOperation = {})` ## Group Actions * `archiveGroup(accountAlias, groupId, payload = {})` * `restoreGroup(accountAlias, groupId, targetGroupId)` ## Power Operations * `setPowerOperation(accountAlias, powerOperation, serverIds = {})` * `setMaintenanceMode(accountAlias, servers = {})` ## Public IP * `addPublicIpAddress(accountAlias, serverId, payload = {})` * `getPublicIpAddress(accountAlias, serverId, publicIP)` * `deletePublicIpAddress(accountAlias, serverId, publicIP)` * `updatePublicIpAddress(accountAlias, serverId, publicIP, payload = {})` ## Queue * `getQueueStatus(accountAlias, serverId)` ## Servers * `getserverDetails(accountAlias, serverId)` * `createServer(accountAlias, payload = {})` * `deleteServer(accountAlias, serverId)` * `getServerCredentials(accountAlias, serverId)` * `setServerCpuOrMemory(accountAlias, serverId, payload = {})` * `setServerCredentials(accountAlias, serverId, payload = {})` * `setServerCustomFields(accountAlias, serverId, payload = {})` * `setServerDescriptionOrGroup(accountAlias, serverId, payload = {})` * `setServerDisks(accountAlias, serverId, payload = {})` ## Server Actions * `archiveServer(accountAlias, serverIds = {})` * `createSnapShot(accountAlias, payload = {})` * `executePackage(accountAlias, payload = {})` * `restoreServer(accountAlias, targetGroupId)` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing 1. Fork it ( https://github.com/[my-github-username]/clc_client/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am `Add some feature``) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request