Manage Endpoints

To add an endpoint you can use this command :

   grizzly create endpoint [-- <args>]

Arguments :
– microservice : microservice name – Required
– path : endpoint path – Required
– method : to method of the endpoint (GET/POST/PUT/DELETE) – Required
– collection : to specify the collection that will be linked to the endpoint
– version : to specify in which version of microservice you want to add this endpoint (the default version is 1.0.0)
– endpointgroup : to specify in which endpoint group of microservice you want to add this endpoint (the default endpoint group is the last one)
– pathvariables : to specify path variables of the endpoint
– headers : to specify the headers variables – Without spaces between the value and its type (See Examples Below)
– queries : to specify the query parameters – Without spaces between the value and its type (See Examples Below)
– formdatas : to pass a form data within a body query
– modelfile : to add a model to the added endpoint ( it’s a Typescript format )
– bodytype : to specify the type of your request body (array / object) – object by default
– bodymodel : to specify the request body model
– responsetype : to specify the type of your response (array / object) – object by default
– responsemodel : to specify the response model

Example (Minimal version) :

grizzly create endpoint --microservice Products --path /cars --method GET --collection car --bodytype array

Example (with headers) :

grizzly create endpoint --microservice Products --path /cars --method GET --collection car --headers header1:string header2:number

Example (with queries) :

grizzly create endpoint --microservice Products --path /cars --method GET --collection car --queries query1:string query2:number

To delete an endpoint you can use this command :

   grizzly delete endpoint [-- <args>]

Arguments :
– microservice : to specify the name of the microservice – Required
– version : to specify which version of the microservice – Required
– endpointgroup : to specify the endpoint group of the endpoint to delete – Required
– path : to specify the path of the endpoint to delete – Required
– method : to specify the method of the endpoint to delete – Required
Example :

   grizzly delete endpoint --microservice Products --version 1.0.1 --endpointgroup Untitled --path /products --method GET

To secure a specified endpoint for some roles you can use this command :

   grizzly secure endpoint [-- <args>]

Arguments :
– microservice : to specify the name of the microservice – Required
– version : to specify which version of the microservice– Required
– endpointgroup : to specify the endpoint group of the endpoint to secure – Required
– path : to specify the path of the endpoint to secure – Required
– method : to specify the method of the endpoint to secure – Required
– roles : to specify the roles of who can access the endpoint – Required

Example :

     grizzly secure endpoint --microservice Products --version 1.0.1 --endpointgroup Untitled --path /products --method GET --roles admin

To unsecure a specified endpoint :

   grizzly unsecure endpoint [-- <args>]

Arguments :
– microservice : to specify the name of the microservice – Required
– version : to specify which version of the microservice – Required
– endpointgroup : to specify the endpoint group of the endpoint to unsecure – Required
– path : to specify the path of the endpoint to unsecure – Required
– method : to specify the method of the endpoint to unsecure – Required
Example :

     grizzly unsecure endpoint --microservice Products --version 1.0.1 --endpointgroup Untitled --path /products --method GET