2016-10-14 14:51:09 +03:00
|
|
|
# cloudapi-graphql
|
2016-10-10 18:37:26 +03:00
|
|
|
|
2016-10-14 14:51:09 +03:00
|
|
|
Proof-of-Concept of the [Joyent Cloud API](https://apidocs.joyent.com/cloudapi/) running on GraphQL.
|
2016-10-10 18:37:26 +03:00
|
|
|
|
2016-10-10 19:38:58 +03:00
|
|
|
## Setup
|
2016-10-10 18:37:26 +03:00
|
|
|
|
2016-10-10 19:38:58 +03:00
|
|
|
### Setup Credentials
|
2016-10-10 18:37:26 +03:00
|
|
|
|
2016-10-10 19:38:58 +03:00
|
|
|
Create `credentials.json`, TODO, use environment variables.
|
2016-10-10 18:37:26 +03:00
|
|
|
|
2016-10-10 18:50:27 +03:00
|
|
|
```json5
|
2016-10-10 18:37:26 +03:00
|
|
|
{
|
|
|
|
"url": "https://us-sw-1.api.joyentcloud.com",
|
|
|
|
"keyId": "", //public key fingerprint ex: 35:jh:42:56...
|
|
|
|
"account": "", // account ex: raoulmillais
|
|
|
|
"user": "" // sub-account ex: ramitos
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2016-10-10 19:38:58 +03:00
|
|
|
### Install Dependencies and run
|
|
|
|
|
|
|
|
```bash
|
2016-10-27 18:01:32 +03:00
|
|
|
yarn install
|
|
|
|
yarn start
|
2016-10-10 19:38:58 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### Visit GraphiQL
|
|
|
|
|
|
|
|
Go-to http://0.0.0.0:3000/graphql to use the REPL with interactive documentation.
|
|
|
|
|
|
|
|
![GraphiQL](https://cloud.githubusercontent.com/assets/524382/19242455/1e371978-8f0b-11e6-9563-d6f5b93fa63c.png)
|
|
|
|
|
|
|
|
## API
|
2016-10-10 18:37:26 +03:00
|
|
|
|
|
|
|
- [x] Account
|
|
|
|
- [x] GetAccount
|
|
|
|
- [x] UpdateAccount
|
|
|
|
- [x] Keys
|
|
|
|
- [x] ListKeys
|
|
|
|
- [x] GetKey
|
|
|
|
- [x] CreateKey
|
|
|
|
- [x] DeleteKey
|
|
|
|
- [x] Users
|
|
|
|
- [x] ListUsers
|
|
|
|
- [x] GetUser
|
|
|
|
- [x] CreateUser
|
|
|
|
- [x] UpdateUser
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] ChangeUserPassword
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] DeleteUser
|
2016-10-10 18:50:27 +03:00
|
|
|
- [x] Roles
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListRoles
|
|
|
|
- [x] GetRole
|
|
|
|
- [x] CreateRole
|
|
|
|
- [x] UpdateRole
|
|
|
|
- [x] DeleteRole
|
2016-10-10 18:50:27 +03:00
|
|
|
- [x] Role Tags
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] SetRoleTags
|
2016-10-10 18:50:27 +03:00
|
|
|
- [x] Policies
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListPolicies
|
|
|
|
- [x] GetPolicy
|
|
|
|
- [x] CreatePolicy
|
|
|
|
- [x] UpdatePolicy
|
|
|
|
- [x] DeletePolicy
|
2016-10-10 18:50:27 +03:00
|
|
|
- [x] User SSH Keys
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListUserKeys
|
|
|
|
- [x] GetUserKey
|
|
|
|
- [x] CreateUserKey
|
|
|
|
- [x] DeleteUserKey
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] Config
|
|
|
|
- [ ] GetConfig
|
|
|
|
- [ ] UpdateConfig
|
|
|
|
- [x] Datacenters
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListDatacenters
|
|
|
|
- [x] GetDatacenter
|
2016-10-10 18:50:27 +03:00
|
|
|
- [x] Services
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListServices
|
2016-10-10 18:50:27 +03:00
|
|
|
- [x] Images
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListImages
|
|
|
|
- [x] GetImage
|
|
|
|
- [x] DeleteImage
|
|
|
|
- [x] ExportImage
|
|
|
|
- [x] CreateImageFromMachine
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] UpdateImage
|
|
|
|
- [x] Packages
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListPackages
|
|
|
|
- [x] GetPackage
|
2016-10-10 18:50:27 +03:00
|
|
|
- [x] Instances
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListMachines
|
|
|
|
- [x] GetMachine
|
|
|
|
- [x] CreateMachine
|
|
|
|
- [x] StopMachine
|
|
|
|
- [x] StartMachine
|
|
|
|
- [x] RebootMachine
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] ResizeMachine
|
|
|
|
- [ ] RenameMachine
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] EnableMachineFirewall
|
|
|
|
- [x] DisableMachineFirewall
|
|
|
|
- [x] CreateMachineSnapshot
|
|
|
|
- [x] StartMachineFromSnapshot
|
|
|
|
- [x] ListMachineSnapshots
|
|
|
|
- [x] GetMachineSnapshot
|
|
|
|
- [x] DeleteMachineSnapshot
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] UpdateMachineMetadata
|
|
|
|
- [ ] ListMachineMetadata
|
|
|
|
- [ ] GetMachineMetadata
|
|
|
|
- [ ] DeleteMachineMetadata
|
|
|
|
- [ ] DeleteAllMachineMetadata
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] AddMachineTags
|
|
|
|
- [x] ReplaceMachineTags
|
|
|
|
- [ ] ListMachineTags
|
|
|
|
- [x] GetMachineTag
|
|
|
|
- [x] DeleteMachineTag
|
|
|
|
- [x] DeleteMachineTags
|
|
|
|
- [x] DeleteMachine
|
|
|
|
- [x] MachineAudit
|
2016-10-10 18:51:27 +03:00
|
|
|
- [ ] Analytics
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] DescribeAnalytics
|
|
|
|
- [ ] ListInstrumentations
|
|
|
|
- [ ] GetInstrumentation
|
|
|
|
- [ ] GetInstrumentationValue
|
|
|
|
- [ ] GetInstrumentationHeatmap
|
|
|
|
- [ ] GetInstrumentationHeatmapDetails
|
|
|
|
- [ ] CreateInstrumentation
|
|
|
|
- [ ] DeleteInstrumentation
|
2016-10-10 18:51:27 +03:00
|
|
|
- [x] FirewallRules
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] Firewall Rule Syntax
|
|
|
|
- [x] ListFirewallRules
|
|
|
|
- [x] GetFirewallRule
|
|
|
|
- [x] CreateFirewallRule
|
|
|
|
- [x] UpdateFirewallRule
|
|
|
|
- [x] EnableFirewallRule
|
|
|
|
- [x] DisableFirewallRule
|
|
|
|
- [x] DeleteFirewallRule
|
|
|
|
- [x] ListMachineFirewallRules
|
|
|
|
- [x] ListFirewallRuleMachines
|
2016-10-10 18:51:27 +03:00
|
|
|
- [ ] Fabrics
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] ListFabricVLANs
|
|
|
|
- [ ] CreateFabricVLAN
|
|
|
|
- [ ] GetFabricVLAN
|
|
|
|
- [ ] UpdateFabricVLAN
|
|
|
|
- [ ] DeleteFabricVLAN
|
|
|
|
- [ ] ListFabricNetworks
|
|
|
|
- [ ] CreateFabricNetwork
|
|
|
|
- [ ] GetFabricNetwork
|
|
|
|
- [ ] DeleteFabricNetwork
|
2016-10-10 18:51:27 +03:00
|
|
|
- [x] Networks
|
2016-10-10 18:37:26 +03:00
|
|
|
- [x] ListNetworks
|
|
|
|
- [x] GetNetwork
|
2016-10-10 18:51:27 +03:00
|
|
|
- [ ] Nics
|
2016-10-10 18:50:27 +03:00
|
|
|
- [ ] ListNics
|
|
|
|
- [ ] GetNic
|
|
|
|
- [ ] AddNic
|
|
|
|
- [ ] RemoveNic
|