Skip to content
Newer
Older
100644 153 lines (95 sloc) 4.13 KB
8050ed9 @jfhbrook Newly-generated documentation
jfhbrook authored Jul 22, 2011
1 # JSON API
389b9cd @jfhbrook Regenerated documentations
jfhbrook authored Aug 8, 2011
2 <a name='api'></a>
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 25, 2011
3
4 Nodejitsu provides a web API for developers who want to interact with the
5 Nodejitsu platform programatically. This API is built to be
6 [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) and
7 communicates via [JSON](http://en.wikipedia.org/wiki/JSON). The API is the most
8 low-level way of interacting with the Nodejitsu platform. For most deployment
9 scenarios you should use our command line tool, [jitsu](#jitsu), or the
10 [online administrative interface](#webapp).
11
1b829b1 @jfhbrook [dist] Regenerated
jfhbrook authored Dec 20, 2011
12 ## API Clients
13
14 Nodejitsu has a JSON API client for node.js, which may be found [here](https://github.com/nodejitsu/nodejitsu-api) (along with API clients in other languages as they are developed). Jitsu is implemented by using the node.js API client.
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
15
16 ## Authentication
17
1b829b1 @jfhbrook [dist] Regenerated
jfhbrook authored Dec 20, 2011
18 Most of the calls to the API will require that you authenticate using your Nodejitsu account. If you do not have an account it is possible to create one using the API, the [jitsu CLI](#jitsu), or just by visiting [http://nodejitsu.com](http://nodejitsu.com). Currently, we support [Basic Authentication](http://en.wikipedia.org/wiki/Basic_access_authentication). If you haven't used Basic Auth before, don't fret; it's easy!
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
19
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
20 Here is an example using the command line utility,
21 [Curl](http://curl.haxx.se/):
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
22
23 // get all applications for User "Marak"
dce353a @3rd-Eden [doc] use HTTPS instead of HTTP to access the Nodejitsu API
3rd-Eden authored Aug 3, 2012
24 curl --user Marak:password https://api.nodejitsu.com/apps/marak
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
25
26 ## Applications
27
5820c08 @jfhbrook [dist] Generated book
jfhbrook authored Dec 20, 2011
28 Applications are the core of the Nodejitsu API. Each application represents a set of Node.js code plus a package.json which contains meta-data about the application such as it's dependencies, database connections, configuration settings and authors. For more information about the package.json format see: [package.json](#package_json)
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
29
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
30 ### Get all Applications for a User
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
31
32 GET /apps/:user-id
33
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
34 ### Create a new Application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
35
36 POST /apps/:user-id
37 { package.json }
38
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
39 ### Start an Application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
40
41 POST /apps/:user-id/:app-id/start
42
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
43 ### Stop an Application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
44
45 POST /apps/:user-id/:app-id/stop
46
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
47 ### Restart an Application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
48
49 POST /apps/:user-id/:app-id/restart
50
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
51 ### Update an Application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
52
53 PUT /apps/:user-id
54 { package.json }
55
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
56 ### Delete an Application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
57
306fedb @jfhbrook [dist] regen
jfhbrook authored Mar 27, 2012
58 DELETE /apps/:user-id/:app-id/remove
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
59
60 ## Snapshots
61
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
62 ### Make an existing snapshot the active app
2e2f23d @jfhbrook [dist] Regenerate.
jfhbrook authored Jun 11, 2012
63 POST /apps/:user-id/:app-id/snapshots/:id/activate
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
64
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
65 ### Activate / Deploy a snapshot
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
66 POST /apps/:user-id/:snapshots/:id
67
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
68 ### Show a catalog of all Snapshot for an Application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
69 GET /apps/:user-id/:app-id/snapshots
70
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
71 ### Show the contents of a Snapshot
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
72 GET /apps/:user-id/:app-id/snapshots/:id
73
74
75 ## Users
76
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
77 ### Create a new User / Sign-up for a free Nodejitsu account
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
78
79 Email address is the only required field.
80
81 POST /users/:user-id
82 {
83 email: "youremail@theinternet.com"
84 }
85
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
86 ### Confirm a User account
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
87
88 All User accounts must be confirmed. When a new User is created, a confirmation email will be sent to the email address associated with that user. In this email there will be an invite code. This code must be sent to the API to confirm the account.
89
90 POST /users/:user-id
91 {
92 inviteCode: "SecretCode"
93 }
94
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
95 ### Update User
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
96
97 PUT /users/:user-id
98 {
99 password: "new_password"
100 }
101
102 ## Databases
103
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
104 ### Create a new Database
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
105
106 POST /databases/:user-id/:database-id
107 {
389b9cd @jfhbrook Regenerated documentations
jfhbrook authored Aug 8, 2011
108 type: "couch" || "redis" || "mongo"
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
109 }
110
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
111 ### Get information about a Database
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
112
113 GET /databases/:user-id/:database-id
114
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
115 ### Delete a Database
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
116
117 DELETE /databases/:user-id/:database-id
118
119 ## Logging
120
389b9cd @jfhbrook Regenerated documentations
jfhbrook authored Aug 8, 2011
121 Logging is a very important feature in any professional grade Node.js
122 application. Nodejitsu provides integrated logging solutions for your
123 applications. Your logs are always saved and ready to be retrieved.
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
124
125 ### Get all logs for a user
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
126
69d916a @jfhbrook Regenerated docs
jfhbrook authored Sep 2, 2011
127 POST /logs/:user-id/
128 {
129 "from": "NOW-3YEARS",
130 "until": "NOW",
131 "rows": 15
132 }
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
133
361dbbd @jfhbrook [doc] Fixed malformed documents!
jfhbrook authored Jul 26, 2011
134 ### Get logs for a specific application
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
135
69d916a @jfhbrook Regenerated docs
jfhbrook authored Sep 2, 2011
136 POST /logs/:user-id/:app-id
137 {
138 "from": "NOW-3YEARS",
139 "until": "NOW",
140 "rows": 15
141 }
de95528 @AvianFlu [fix] Moved API instructions
AvianFlu authored Jun 6, 2011
142
143 ## Marketplace
144
145 #### Get all Marketplace Applications
146
147 GET /marketplace
148
149 #### Get a specific Marketplace Application
150
151 GET /databases/:user-id/:id
152
Something went wrong with that request. Please try again.