Skip to content

Commit 22606ea

Browse files
authored
Merge pull request #18 from cloudops/cmc-dev
V1 of CloudMC doc
2 parents d2371a7 + 4f05a11 commit 22606ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2265
-1073
lines changed

README.md

Lines changed: 7 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,24 @@
1-
<p align="center">
2-
<img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
3-
<br>
4-
<a href="https://travis-ci.org/lord/slate"><img src="https://travis-ci.org/lord/slate.svg?branch=master" alt="Build Status"></a>
5-
</p>
61

7-
<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>
8-
9-
<p align="center"><img src="https://raw.githubusercontent.com/lord/img/master/screenshot-slate.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p>
10-
11-
<p align="center"><em>The example above was created with Slate. Check it out at <a href="https://lord.github.io/slate">lord.github.io/slate</a>.</em></p>
12-
13-
Features
2+
CloudMC API documentation
143
------------
154

16-
* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print.
17-
18-
* **Everything on a single page** — Gone are the days when your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy.
19-
20-
* **Slate is just Markdown** — When you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. Everything is written in Markdown — even the code samples are just Markdown code blocks.
21-
22-
* **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown.
5+
This repository contains the CloudMC API documentation
236

24-
* **Out-of-the-box syntax highlighting** for [over 100 languages](https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers), no configuration required.
25-
26-
* **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents.
27-
28-
* **Let your users update your documentation for you** — By default, your Slate-generated documentation is hosted in a public Github repository. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to use GitHub, you're also welcome to host your docs elsewhere.
29-
30-
Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://lord.github.io/slate).
31-
32-
Getting Started with Slate
7+
Writing new documentation
338
------------------------------
349

3510
### Prerequisites
3611

3712
You're going to need:
3813

3914
- **Linux or OS X** — Windows may work, but is unsupported.
40-
- **Ruby, version 2.3.1 or newer**
15+
- **Ruby, version 2.2.5 or newer**
4116
- **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal.
4217

4318
### Getting Set Up
4419

45-
1. Fork this repository on Github.
46-
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
47-
3. `cd slate`
20+
1. Clone this repository
21+
2. `cd slate`
4822
4. Initialize and start Slate. You can either do this locally, or with Vagrant:
4923

5024
```shell
@@ -58,57 +32,6 @@ vagrant up
5832

5933
You can now see the docs at http://localhost:4567. Whoa! That was fast!
6034

61-
Now that Slate is all set up on your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/lord/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/lord/slate/wiki/Deploying-Slate).
35+
Now that Slate is all set up on your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/lord/slate/wiki/Markdown-Syntax)
6236

6337
If you'd prefer to use Docker, instructions are available [in the wiki](https://github.com/lord/slate/wiki/Docker).
64-
65-
### Note on JavaScript Runtime
66-
67-
For those who don't have JavaScript runtime or are experiencing JavaScript runtime issues with ExecJS, it is recommended to add the [rubyracer gem](https://github.com/cowboyd/therubyracer) to your gemfile and run `bundle` again.
68-
69-
Companies Using Slate
70-
---------------------------------
71-
72-
* [NASA](https://api.nasa.gov)
73-
* [IBM](https://docs.cloudant.com/api.html)
74-
* [Sony](http://developers.cimediacloud.com)
75-
* [Best Buy](https://bestbuyapis.github.io/api-documentation/)
76-
* [Travis-CI](https://docs.travis-ci.com/api/)
77-
* [Greenhouse](https://developers.greenhouse.io/harvest.html)
78-
* [Woocommerce](http://woocommerce.github.io/woocommerce-rest-api-docs/)
79-
* [Appium](http://appium.io/slate/en/master)
80-
* [Dwolla](https://docs.dwolla.com/)
81-
* [Clearbit](https://clearbit.com/docs)
82-
* [Coinbase](https://developers.coinbase.com/api)
83-
* [Parrot Drones](http://developer.parrot.com/docs/bebop/)
84-
* [Fidor Bank](http://docs.fidor.de/)
85-
* [Scale](https://docs.scaleapi.com/)
86-
87-
You can view more in [the list on the wiki](https://github.com/lord/slate/wiki/Slate-in-the-Wild).
88-
89-
Need Help? Found a bug?
90-
--------------------
91-
92-
[Submit an issue](https://github.com/lord/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes.
93-
94-
Contributors
95-
--------------------
96-
97-
Slate was built by [Robert Lord](https://lord.io) while interning at [TripIt](https://www.tripit.com/).
98-
99-
Thanks to the following people who have submitted major pull requests:
100-
101-
- [@chrissrogers](https://github.com/chrissrogers)
102-
- [@bootstraponline](https://github.com/bootstraponline)
103-
- [@realityking](https://github.com/realityking)
104-
- [@cvkef](https://github.com/cvkef)
105-
106-
Also, thanks to [Sauce Labs](http://saucelabs.com) for sponsoring the development of the responsive styles.
107-
108-
Special Thanks
109-
--------------------
110-
- [Middleman](https://github.com/middleman/middleman)
111-
- [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js)
112-
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
113-
- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
114-
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)

lib/toc_data.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def toc_data(page_content)
55

66
# get a flat list of headers
77
headers = []
8-
html_doc.css('h1, h2, h3').each do |header|
8+
html_doc.css('h1, h2, h3, h4').each do |header|
99
headers.push({
1010
id: header.attribute('id').to_s,
1111
content: header.children,
@@ -14,7 +14,7 @@ def toc_data(page_content)
1414
})
1515
end
1616

17-
[3,2].each do |header_level|
17+
[4,3,2].each do |header_level|
1818
header_to_nest = nil
1919
headers = headers.reject do |header|
2020
if header[:level] == header_level

source/images/favicon.png

2.6 KB
Loading

source/images/logo.png

-911 Bytes
Loading

source/includes/_administration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Administration API
1+
# Administration
22

33
The following sections describe the various endpoints exposed by CloudMC to manage customer's configuration and interact with various core functionality of the system. Using these, you can automate various workflows without having to log into the portal, or simply integrate different aspects of CloudMC with your own toolchain.
44
<aside class="notice">

source/includes/_cloudstack.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# CloudStack API
1+
# CloudStack plugin
22

3-
The CloudStack API provides endpoints for carrying out operations on CloudMC compute and networking entities. While each operation has its own validation and required fields, all operations need to specify the service code and environment in which they should be carried out. The following example URL describes how to specify this information for all entities.
3+
The CloudStack plugin provides endpoints for carrying out operations on CloudMC compute and networking entities. While each operation has its own validation and required fields, all operations need to specify the service code and environment in which they should be carried out. The following example URL describes how to specify this information for all entities.
44

5-
<code>https://cloudmc_endpoint/v1/services/<a href="#service-connections">:service_code</a>/<a href="#environments">:environment_name</a>/:entity_type</code>
6-
7-
The two CloudStack service codes currently available in CloudMC correspond to compute regions: `compute-qc` for Québec, and `compute-on` for Ontario.
5+
<code>https://cloudmc_endpoint/v1/services/<a href="#administration-service-connections">:service_code</a>/<a href="#administration-environments">:environment_name</a>/:entity_type</code>
86

97
<aside class="notice">
108
An easy way to remember the structure of API endpoints is that going from left to right, the scope gets progressively more specific. First service, then environment of that service, then entity type, then operation on that entity type, etc.

source/includes/_errors.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

source/includes/_getting_started.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,15 @@ The API is [RESTful](https://en.wikipedia.org/wiki/Representational_state_trans
66

77
API endpoint : `https://cloudmc_endpoint/v1`
88

9-
<!-- We have also developed tools to help consume our APIs. If you use `go`, check out our [library](https://github.com/cloud-ca/go-cloudca). If you use Terraform, check out our [provider](https://github.com/cloud-ca/terraform-cloudca). NB: both are being actively developed, so there is still some functionality missing.
10-
-->
119
## Authentication
12-
<!-- ```go
13-
import "github.com/cloud-ca/go-cloudca"
14-
ccaClient := cca.NewCcaClient("your_api_key")
15-
```
16-
-->
10+
1711
```shell
1812
## To authenticate, add a header
1913
## Make sure to replace `your_api_key` with your API key.
2014
curl "https://cloudmc_endpoint/v1/organizations" \
2115
-H "MC-Api-Key: your_api_key"
2216
```
2317

24-
<!-- ```dart
25-
provider "cloudca" {
26-
api_key = "${var.my_api_key}"
27-
}
28-
``` -->
29-
3018
API endpoints are secured by the same role-based access control (RBAC) as the CloudMC portal. To identify who is making the requests, it is required to add a header to your HTTP requests:
3119

3220
`MC-Api-Key: your_api_key`
@@ -91,8 +79,8 @@ When an API request is successful, the response body will contain the `data` fie
9179
Attributes | &nbsp;
9280
--- | ---
9381
`data` | The data field contains the object requested by the API caller
94-
`taskId` | The [task id](#tasks) of an operation executed through the [compute API](#compute-api)
95-
`taskStatus` | The status of a [task](#tasks) of an operation executed through the [compute API](#compute-api)
82+
`taskId` | The [task id](#tasks) of an operation executed through the services API
83+
`taskStatus` | The status of a [task](#tasks) of an operation executed the services API
9684
<!--
9785
`metadata` | The metadata is an optionally returned field containing paging and sorting information
9886
-->
@@ -121,22 +109,6 @@ If the response contains the "errors" field, the request was <strong>not</strong
121109
]
122110
}
123111
```
124-
```go
125-
_, err := ccaResources.Volumes.Get("[some-volume-id]")
126-
if err != nil {
127-
if errorResponse, ok := err.(api.CcaErrorResponse); ok {
128-
if errorResponse.StatusCode == api.NOT_FOUND {
129-
fmt.Println("Volume was not found")
130-
} else {
131-
//Can get more details from the CcaErrors
132-
fmt.Println(errorResponse.Errors)
133-
}
134-
} else {
135-
//handle unexpected error
136-
panic("Unexpected error")
137-
}
138-
}
139-
```
140112

141113
When an API request is unsuccessful, the response body will contain the `errors` field :
142114

source/includes/_openstack.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# OpenStack plugin
2+
3+
The CloudMC OpenStack plugin incorporates various OpenStack services such as Nova and Neutron into CloudMC's API. It also enforces CloudMC's environment-centric multi-tenancy model and RBAC over top of OpenStack.

0 commit comments

Comments
 (0)