-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from 3scale/crud-metrics
Crud metrics
- Loading branch information
Showing
111 changed files
with
2,889 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,12 @@ See the LICENSE and NOTICE files that should have been provided along with this | |
* [Copy a service](#copy-a-service) | ||
* [Update a service](#update-a-service) | ||
* [Import from CSV](#import-from-csv) | ||
* [Import from OpenAPI definition](#import-openapi) | ||
* [Export/Import Application Plan](#export-import-application-plan) | ||
* [Import from OpenAPI definition](docs/openapi.md) | ||
* [Export/Import Application Plan](docs/export-import-app-plan.md) | ||
* Create, Apply, List, Show, Delete [Application plan](docs/app-plan.md) | ||
* [Remotes](#remotes) | ||
* Create, Apply, List, Delete [Metric](docs/metric.md) | ||
* Create, Apply, List, Delete [Method](docs/method.md) | ||
* [Remotes](docs/remotes.md) | ||
* [Development](#development) | ||
* [Testing](#testing) | ||
* [Develop your own core command](#develop-core-command) | ||
|
@@ -196,26 +198,6 @@ Example: | |
3scale import csv --destination=https://[email protected] --file=examples/import_example.csv | ||
``` | ||
|
||
### Import OpenAPI | ||
|
||
Using an API definition format like OpenAPI, import to your 3scale API | ||
|
||
Currently, only OpenAPI __2.0__ specification (f.k.a. __swagger__) is supported. | ||
|
||
[Import from OpenAPI](docs/openapi.md) | ||
|
||
### Export Import Application Plan | ||
|
||
A single application plan can be exported/imported as `yaml` format. | ||
|
||
[Export/Import Application Plan](docs/export-import-app-plan.md) | ||
|
||
### Remotes | ||
|
||
Manage set of 3scale instances. | ||
|
||
[Howto](docs/remotes.md) | ||
|
||
## Development | ||
|
||
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec 3scale` to use the gem in this directory, ignoring other installed copies of this gem. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
## Method | ||
|
||
* [Create new method](#create) | ||
* [Apply method](#apply) | ||
* [List methods](#list) | ||
* [Delete method](#delete) | ||
|
||
### Create | ||
|
||
* Creates a new method | ||
* Only method name is required. `system-name` can be override with optional parameter. | ||
* `service` positional argument is a service reference. It can be either service `id`, or service `system_name`. Toolbox will figure it out. | ||
* This is not idempotent command. If method with the same name already exists, command will fail. | ||
* Create a `disabled` method by `--disabled` flag. By default, it will be `enabled`. | ||
* Several other options can be set. Check `usage` | ||
|
||
```shell | ||
NAME | ||
create - create method | ||
|
||
USAGE | ||
3scale methods create [opts] <remote> | ||
<service> <method-name> | ||
|
||
DESCRIPTION | ||
Create method | ||
|
||
OPTIONS | ||
--description=<value> Method description | ||
--disabled Disables this method in all application | ||
plans | ||
-t --system-name=<value> Method system name | ||
|
||
OPTIONS FOR METHODS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` | ||
|
||
### Apply | ||
|
||
* Update existing method. Create new one if it does not exist. | ||
* `service` positional argument is a service reference. It can be either service `id`, or service `system_name`. Toolbox will figure it out. | ||
* `method` positional argument is a method reference. It can be either method `id`, or method `system_name`. Toolbox will figure it out. | ||
* This is command is `idempotent`. | ||
* Update to `disabled` method by `--disabled` flag. | ||
* Update to `enabled` method by `--enabled` flag. | ||
* Several other options can be set. Check `usage` | ||
|
||
```shell | ||
NAME | ||
apply - Update method | ||
|
||
USAGE | ||
3scale methods apply [opts] <remote> <service> | ||
<method> | ||
|
||
DESCRIPTION | ||
Update (create if it does not exist) method | ||
|
||
OPTIONS | ||
--description=<value> Method description | ||
--disabled Disables this method in all application | ||
plans | ||
--enabled Enables this method in all application | ||
plans | ||
-n --name=<value> Method name | ||
|
||
OPTIONS FOR METHODS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` | ||
### List | ||
```shell | ||
NAME | ||
list - list methods | ||
|
||
USAGE | ||
3scale methods list [opts] <remote> <service> | ||
|
||
DESCRIPTION | ||
List methods | ||
|
||
OPTIONS FOR METHODS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` | ||
### Delete | ||
```shell | ||
NAME | ||
delete - delete method | ||
|
||
USAGE | ||
3scale methods delete [opts] <remote> | ||
<service> <method> | ||
|
||
DESCRIPTION | ||
Delete method | ||
|
||
OPTIONS FOR METHODS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
## Metric | ||
|
||
* [Create new metric](#create) | ||
* [Apply metric](#apply) | ||
* [List metrics](#list) | ||
* [Delete metric](#delete) | ||
|
||
### Create | ||
|
||
* Creates a new metric | ||
* Only metric name is required. `system-name` can be override with optional parameter. | ||
* `service` positional argument is a service reference. It can be either service `id`, or service `system_name`. Toolbox will figure it out. | ||
* This is not idempotent command. If metric with the same name already exists, command will fail. | ||
* Create a `disabled` metric by `--disabled` flag. By default, it will be `enabled`. | ||
* Several other options can be set. Check `usage` | ||
|
||
```shell | ||
NAME | ||
create - create metric | ||
|
||
USAGE | ||
3scale metrics create [opts] <remote> | ||
<service> <metric-name> | ||
|
||
DESCRIPTION | ||
Create metric | ||
|
||
OPTIONS | ||
--description=<value> Metric description | ||
--disabled Disables this metric in all application | ||
plans | ||
-t --system-name=<value> Application plan system name | ||
--unit=<value> Metric unit. Default hit | ||
|
||
OPTIONS FOR METRICS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` | ||
|
||
### Apply | ||
|
||
* Update existing metric. Create new one if it does not exist. | ||
* `service` positional argument is a service reference. It can be either service `id`, or service `system_name`. Toolbox will figure it out. | ||
* `metric` positional argument is a metric reference. It can be either metric `id`, or metric `system_name`. Toolbox will figure it out. | ||
* This is command is `idempotent`. | ||
* Update to `disabled` metric by `--disabled` flag. | ||
* Update to `enabled` metric by `--enabled` flag. | ||
* Several other options can be set. Check `usage` | ||
|
||
```shell | ||
NAME | ||
apply - Update metric | ||
|
||
USAGE | ||
3scale metrics apply [opts] <remote> <service> | ||
<metric> | ||
|
||
DESCRIPTION | ||
Update (create if it does not exist) metric | ||
|
||
OPTIONS | ||
--description=<value> Metric description | ||
--disabled Disables this metric in all application | ||
plans | ||
--enabled Enables this metric in all application | ||
plans | ||
-n --name=<value> Metric name | ||
--unit=<value> Metric unit. Default hit | ||
|
||
OPTIONS FOR METRICS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` | ||
### List | ||
```shell | ||
NAME | ||
list - list metrics | ||
|
||
USAGE | ||
3scale metrics list [opts] <remote> <service> | ||
|
||
DESCRIPTION | ||
List metrics | ||
|
||
OPTIONS FOR METRICS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` | ||
### Delete | ||
```shell | ||
NAME | ||
delete - delete metric | ||
|
||
USAGE | ||
3scale metrics delete [opts] <remote> | ||
<service> <metric> | ||
|
||
DESCRIPTION | ||
Delete metric | ||
|
||
OPTIONS FOR METRICS | ||
-c --config-file=<value> 3scale toolbox configuration file (default: | ||
$HOME/.3scalerc.yaml) | ||
-h --help show help for this command | ||
-k --insecure Proceed and operate even for server | ||
connections otherwise considered insecure | ||
-v --version Prints the version of this command | ||
--verbose Verbose mode | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
module ThreeScaleToolbox | ||
module Command | ||
def self.included(base) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.