Giter Club home page Giter Club logo

3scale-cli's People

Contributors

eguzki avatar ffiore avatar hodrigohamalho avatar johnpoth avatar josegorchs avatar kevprice83 avatar leathersole avatar lucamaf avatar picsoung avatar vdel26 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

3scale-cli's Issues

Support for on-prem

Hello
The current version of 3scale-cli does not seem to support on-prem. Can you please confirm? If so, are you planning to support it soon please?
Thanks

being able to copy an Application Plan

Give the possibility to make an exact copy of the Application Plan (on the same service).
some Application Plans have very complex configuration and reproducing it manually is tedious.

extra two-digit number appended to service name

Entering '3scale-cli services create --serviceName mytest', you get a feedback message 'Service with name mytest created. However the actual name of the service created is something like 'mytestXX' where XX is a random number. The reason for this can be seen directly in the source file 'services.js', line 11 that reads:
"var n = name+Math.floor((Math.random() * 50) + 10)".

error with status code 422 when trying to import to saas

When trying to execute the following:
3scale-cli import swagger -f json_vcc.json

I received the following error:```

[ 3scale-cli ] Loading Profiles API37 swagger definition.
[ 3scale-cli ] Service with id 2555417747254 created on 3scale
[ 3scale-cli ] Hits metric with id 2555418049462 found on 3scale
[ 3scale-cli ] Method ndefined_about_assembly_version_GET with system_name ndefined_about_assembly_version_GET created on 3scale.
[ 3scale-cli ] Method ndefined_self_GET with system_name ndefined_self_GET created on 3scale.
[ 3scale-cli ] Method ndefined_self_PUT with system_name ndefined_self_PUT created on 3scale.
[ 3scale-cli ] Method ndefined_settings_market_GET with system_name ndefined_settings_market_GET created on 3scale.
[ 3scale-cli ] Method ndefined_settings_fields_GET with system_name ndefined_settings_fields_GET created on 3scale.
[3scale-cli] ERROR encountered on creating Mapping rule: undefined
/usr/lib/node_modules/node-3scale-cli/node_modules/q/q.js:155
throw e;
^

Error: Server responded with status code 422 undefined
at /usr/lib/node_modules/node-3scale-cli/lib/mappingrules.js:29:13
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
From previous event:
at createMappingRulePromise (/usr/lib/node_modules/node-3scale-cli/lib/swagger.js:131:116)
at /usr/lib/node_modules/node-3scale-cli/node_modules/delay-promise/index.js:15:18
at delay.then (/usr/lib/node_modules/node-3scale-cli/node_modules/delay-promise/index.js:8:33)
From previous event:
at threescale_waterfall (/usr/lib/node_modules/node-3scale-cli/lib/swagger.js:92:4)
at /usr/lib/node_modules/node-3scale-cli/lib/swagger.js:40:11


the swagger definition is attached.
[swagger.json.txt](https://github.com/3scale/3scale-cli/files/1207820/swagger.json.txt)

3scale-cli and Your credentials are invalid

Trying to use 3scale-cli but fails at configuration.

C:> 3scale-cli config
[ 3scale-cli ] Please answer the following questions to configure 3scale cli.
? 3scale access token 015e77038cccbxxxxxxxxxxxxxxxxxxxxxxxxxxxxxad8f2d0854f352
? 3scale id myaccount
? 3scale wildcard domain 3scale.net
[3scale-cli] ERROR encountered: Your credentials are invalid. Check them and try again.

The access token have read&write to Billing API, Account Management API, and Analytics API
I have also tried with another access token (that I am using for gateway and getting config) - same fault.

Any idea what could be wrong?

Cli does not provide a self-managed gateway option

When a service is created using the cli, it assumes that the gateway inbuilt in the SaaS will be used.
One cannot change this to self-managed gateway.
The cli should probably be parametrized to accept user input on what gateway to choose: Saas inbuilt or self-managed. The corresponding management api does provide a 'deployment' option parameter.

422 error when trying to create a new service from swagger definition

Launched the following command:
3scale-cli import swagger -f swagger-mock.yaml -p {method}_{path}

with the attached file
swagger-mock.yaml.txt

and received the following error while processing it:

[3scale-cli] ERROR encountered on creating Mapping rule: undefined
/usr/lib/node_modules/node-3scale-cli/node_modules/q/q.js:155
                throw e;
                ^

Error: Server responded with status code 422 undefined
    at /usr/lib/node_modules/node-3scale-cli/lib/mappingrules.js:29:13
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
From previous event:
    at createMappingRulePromise (/usr/lib/node_modules/node-3scale-cli/lib/swagger.js:123:113)
    at /usr/lib/node_modules/node-3scale-cli/node_modules/delay-promise/index.js:15:18
    at delay.then (/usr/lib/node_modules/node-3scale-cli/node_modules/delay-promise/index.js:8:33)
From previous event:
    at threescale_waterfall (/usr/lib/node_modules/node-3scale-cli/lib/swagger.js:88:4)
    at /usr/lib/node_modules/node-3scale-cli/lib/swagger.js:36:11

Incorrect parsing of parameters object

The following excerpt of a valid Swagger spec fails when creating the mapping rule:

paths:
  /coffees/{id}:
    get:
      tags:
      - "CoffeeObject"
      description: ""
      operationId: "getCoffeeObject"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "user_key"
        in: "query"
        description: ""
        required: false
        type: "string"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/Coffee"
    parameters:
    - name: "id"
      in: "path"
      description: ""
      required: true
      type: "string"

The second parameter declaration is defined as a direct child of the path item which results in the following error:

ERROR encountered on creating Mapping rule: {"http_method":["is not included in the list"]}

On the output of the import command you can see that the method is created in 3scale with the wrong HTTP verb:

Method _coffees__id__PARAMETERS with system_name _coffees__id__PARAMETERS created on 3scale.

Once the parameters object is moved inside the operation item the tool is able to import the swagger spec successfully.

cc @picsoung

3scale-cli config: SyntaxError: Unexpected token

Just installed 3scale-cli on Ubuntu 16.04. Ran 3scale-cli config and got the following error. Bug?

$ 3scale-cli config
/usr/local/lib/node_modules/node-3scale-cli/node_modules/delay-promise/index.js:11
function creator(...args) {
                 ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/node-3scale-cli/lib/swagger.js:6:17)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

System name mismatch

3scale-cli import from swagger creates a system name say 'Customer30'.
However 3scale-cli activedocs create, creates a system name that is different say 'Customer59'.
These system names, i believe, have to be the same for the Developer portal catalog to work.
Can this be fixed please so that activedocs asks for userinput on systemname- if there is an existing system name to use.
Thanks!

system name as param

For active docs to show up in an API catalog, we need the service's systemname to be the same as the apidocs systemname.
Currently the systemname for activedocs is randomly generated by the cli and so one has to manually re-create active docs if not the same as the service's systemname.

Request: make systemname a user-defined parameter for 'create activedocs' command

service name as parameter

being able to define the service name upon creation from swagger definition instead of using a random name

issue on install: No compatible version found: raml-1-parser@'*'

when installing as:
sudo npm install -g node-3scale-cli
I'm seeing this error:
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "node-3scale-cli"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: raml-1-parser@'*'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.1.0-beta","0.1.0-beta.0","0.1.0-beta.1","0.1.0-beta.2","0.1.0-beta.3","0.1.0-beta.5","0.1.0-beta.6"]
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'node-3scale-cli'
npm ERR! notarget

Any suggestions?

Improve readme

Review commands
Update with latest commands added (e.g. activedocs)
Add screenshots where necessary

Allow Insecure Calls to the 3scale APIs

Many 3scale On-Premises test installations use self-signed certificates. The CLI currently fails as the API calls aren't configured to allow insecure traffic.

Adding this allows them:
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

Request to be able to pass in a flag that sets this in the code.

Add a LICENSE file

This is an open repo and so should make clear the license that applies.
I suggest our common MIT license.

Option to Ignore Duplicates on Swagger Import

Error when importing swagger doc for Research API (https://onega-services.wkgadev.net/api-docs/research)

3scale-cli import swagger -f research.swagger.json -s 2555417754871
[ 3scale-cli ] ERROR: Swagger schema validation failed.
Array items are not unique (indexes 2 and 40) at #/tags

JSON_OBJECT_VALIDATION_FAILED

This section is showing up twice under tags:
{"name":"Search","description":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."}

Host variable in the swagger definition is not copied in the Private Base URL field

I would expect the field in the tool to take into account the private url backend field and automatically copy that into the Private Base URL field.
I attached the definition and here is the command I'm executing:

3scale-cli import swagger -f inditex.json -p {method}_{path} [inditex.json.txt](https://github.com/3scale/3scale-cli/files/1084507/inditex.json.txt)

Creating new limit the value always set to 1

To reproduce the issue try to create a limit setting the value different 1, for instance:
3scale-cli limits create --service 6 --appplan 13 --metric 14 --period week --unit 0

I thought the parameter value is missed in command-limits.js or it's using "unit" parameter instead. Also it seems the place where is set to 1 is: file limits.js file 17

interactive questions are a problem for unattended execution (devops tasks)

I am quite new to nodejs so I might be missing some obvious solutions, if that was the case please be patient with me.
I am using 3scale-cli as a the way to achieve automation on deployment on 3scale gateways. I could have used 3scale REST API if I just had the corresponding swagger file, then with Swagger Codegen I was set to create a client SDK, but that swagger file is nowhere to be found. The product source code in ruby does have the tags for https://github.com/solso/source2swagger, but I do not know how to use it properly and imagine that swagger should be public somewhere? I just could not find it.
Too bad, I based my automation scripts on calling 3scale-cli and data scraping the output to get the ids of the different entities created or listed.
Then I found that some commands require interactive input via 'Inquirer.js'. Initially only 'config' was a problem, I coded an extra command to configure from script with no keyboard input.
But after the last changes I find that also the 'import' command now has interactive prompt.
Unless there is some trick to specify input to be accepted by Inquirer with no human intervention, may I suggest that all functionalities of this tool are made compatible with unattended execution? Many thanks in advance for your suggestions and feedback!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.