|
| 1 | +# Managing resources for an Application |
| 2 | + |
| 3 | +We can use blow command to create resources and bind which resource is created. |
| 4 | +This command depend on [service-catalog](https://svc-cat.io). |
| 5 | + |
| 6 | + |
| 7 | +Use `drycc resources` to create and bind a resource for a deployed application. |
| 8 | + |
| 9 | + $ drycc help resources |
| 10 | + Valid commands for resources: |
| 11 | + |
| 12 | + resources:create create a resource for the application |
| 13 | + resources:list list resources in the application |
| 14 | + resources:describe get a resource detail info in the application |
| 15 | + resources:update update a resource from the application |
| 16 | + resources:destroy delete a resource from the applicationa |
| 17 | + resources:bind bind a resource to servicebroker |
| 18 | + resources:unbind unbind a resource from servicebroker |
| 19 | + |
| 20 | + Use 'drycc help [command]' to learn more. |
| 21 | + |
| 22 | +## Create resource in application |
| 23 | + |
| 24 | +You can create a resource with one `drycc resources:create` command |
| 25 | + |
| 26 | + $ drycc resources:create memcached:custom memcached |
| 27 | + Creating memcached to scenic-icehouse... done |
| 28 | + |
| 29 | +After resources are created, you can list the resources in this application. |
| 30 | + |
| 31 | + $ drycc resources:list |
| 32 | + === scenic-icehouse resources |
| 33 | + memcached memcached:custom |
| 34 | + |
| 35 | +## Bind resources |
| 36 | + |
| 37 | +The resource which is named memcached is created, you can bind the memcached to the application, |
| 38 | +use the command of `drycc resources:bind memcached`. |
| 39 | + |
| 40 | + $ drycc resources:bind memcached |
| 41 | + Binding resource... done |
| 42 | + |
| 43 | +## Describe resources |
| 44 | + |
| 45 | +And use `drycc resources:describe` show the binding detail. If the binding is successful, this command will show the information of connect to the resource. |
| 46 | + |
| 47 | + $ drycc resources:describe memcached |
| 48 | + === scenic-icehouse resource memcached |
| 49 | + plan: memcached:custom |
| 50 | + status: Ready |
| 51 | + binding: Ready |
| 52 | + |
| 53 | + HOST: 10.1.7.241 10.1.7.101 |
| 54 | + PORT: 11211 |
| 55 | + |
| 56 | +## Update resources |
| 57 | + |
| 58 | +You can use the `drycc resources:update` command to upgrade a new plan. |
| 59 | +An example of how to upgrade the plan's capacity to 100MB: |
| 60 | + |
| 61 | + $ drycc resources:update memcached:100 memcached |
| 62 | + Updating memcached to scenic-icehouse... done |
| 63 | + |
| 64 | +## Remove the resource |
| 65 | + |
| 66 | +If you don't need resources, use `drycc resources:unbind` to unbind the resource and then use `drycc resources:destroy` to delete the resource from the application. |
| 67 | +Before deleting the resource, the resource must be unbinded. |
| 68 | + |
| 69 | + $ drycc resources:unbind memcached |
| 70 | + Unbinding resource... done |
| 71 | + |
| 72 | + $ drycc resources:destroy memcached |
| 73 | + Deleting memcached from scenic-icehouse... done |
| 74 | + |
| 75 | + |
0 commit comments