CLI utility to interact with the network mapper and local intents files.

  • By Otterize
  • Last update: Nov 21, 2022
  • Comments: 12

Otterize CLI

build go report community

About | Installation & usage with the network mapper | Docs | Contributing | Slack

About

The Otterize CLI is a command-line utility used to control and interact with the Otterize network mapper, manipulate local intents files, and (coming soon!) interact with Otterize Cloud.

See the CLI command reference for how to use it.

Example output from running the network mapper on the Google Cloud microservices demo:

$ otterize mapper list
cartservice in namespace ecommerce calls:
  - redis-cart
checkoutservice in namespace ecommerce calls:
  - kafka-secure
frontend in namespace ecommerce calls:
  - adservice
  - cartservice
  - checkoutservice
  - currencyservice
  - productcatalogservice
  - recommendationservice
  - shippingservice
kafka-secure in namespace ecommerce calls:
  - kafka-secure
  - lab-zookeeper
paymentservice in namespace ecommerce calls:
  - kafka-secure
recommendationservice in namespace ecommerce calls:
  - productcatalogservice

Installation instructions & usage with the network mapper

Install the network mapper using Helm

helm repo add otterize https://helm.otterize.com
helm repo update
helm install network-mapper otterize/network-mapper -n otterize-system --create-namespace --wait

Install Otterize CLI to query data from the network mapper

Mac

brew install otterize/otterize/otterize-cli

Linux 64-bit

wget https://get.otterize.com/otterize-cli/v0.1.5/otterize_Linux_x86_64.tar.gz
tar xf otterize_Linux_x86_64.tar.gz
sudo cp otterize /usr/local/bin

Windows

scoop bucket add otterize-cli https://github.com/otterize/scoop-otterize-cli
scoop update
scoop install otterize-cli

For more platforms, see the installation guide.

Contributing

  1. Feel free to fork and open a pull request! Include tests and document your code in Godoc style
  2. In your pull request, please refer to an existing issue or open a new one.
  3. See our Contributor License Agreement.

Slack

Join the Otterize Slack!

Download

otterize-cli.zip

Comments(12)

  • 1

    Export intents by default without type

    Description

    This PR remove the default value of HTTP from intent type since it's no longer mandatory to have type for every intent, and by default intents should come without type

  • 2

    bump api - Replace /objects/one endpoint with /object

    • Bump API version after replacing /objects/one endpoint with /object
    • Use oapi-codegen built-in security provider, simplify cloudclient init and struct
  • 3

    Migrate admin CLI commands to REST API

    • Generate cloud API based on openAPI specs (using oapi-codegen)
    • Migrate environments, integrations, users, invites, orgs CLI commands to use the new openAPI-based client
    • Moved existing graphql-bases client impl to cloudclient/graphql (to make room for cloudclient/restapi)
    • As part of the migration & minimizing business logic on the client CLI - remove the --exists-ok flag support. It should be implemented server-side, an issue was opened for it.
  • 4

    Flatten organizations, integrations & environments update body

    https://www.notion.so/otterize/Flatten-REST-update-operations-body-to-match-standards-e-g-eliminate-EnvironmentUpdate-object-and--756f0473f7ee466791b5fbf52e830a15

  • 5

    remove deprecated routes dependencies (part of splitting internal & deprecated graphql repo)

    • remove references to deprecated folder in genqlient configurations.
    • remove GetOrCreateUserDevEnv as it's currently considered deprecated (until further notice).
  • 6

    Migrate administrative commands (users, orgs, invites, envs, integrations) to the new otterize-cli repo

    Migrate users, organizations, invites, environments & integrations commands to the new otterize-cli repo.

    This currently adheres to the standard of otterize <objects> <action> (e.g. otterize users list, rather than otterize list users), which was already applied in this new CLI repo. If and when we choose to reverse the object<>action order we will need to revisit it.

  • 7

    Added "otterize mapper upload"

    The otterize mapper upload downloads the intents discovered by the network-mapper and reports them to the cloud. This task is part of the Acces Graph epic. https://www.notion.so/otterize/Access-Graph-Connect-OSS-CLI-to-the-cloud-and-add-otterize-mapper-upload-412f7e2a03c9402d896b36e7618bf45d

  • 8

    Added "otterize login" command

    Description

    This PR adds the otterize login command to the CLI. This command is used for logging into your otterize account and getting a token that will be used in calls to the otterize API. This is a preparation in order to be able to implement the otterize mapper upload command.

    References

    https://www.notion.so/otterize/Access-Graph-Connect-OSS-CLI-to-the-cloud-and-add-otterize-mapper-upload-412f7e2a03c9402d896b36e7618bf45d

    Testing

    Tested manually by running the "otterize login" command

    • [x] This change adds test coverage for new/changed/fixed functionality

    Checklist

    • [x] I have added documentation for new/changed functionality in this PR and in github.com/otterize/docs
  • 9

    test-netanel

    Please see the contributing guidelines for how to create and submit a high-quality PR for this repo. This template is based on Auth0's excellent template.

    Description

    Describe the purpose of this PR along with any background information and the impacts of the proposed change. For the benefit of the community, please do not assume prior context.

    Provide details that support your chosen implementation, including: breaking changes, alternatives considered, changes to the API, etc.

    References

    Include any links supporting this change such as a:

    • GitHub Issue/PR number addressed or fixed
    • StackOverflow post
    • Related pull requests/issues from other repos

    If there are no references, simply delete this section.

    Testing

    Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

    Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

    Also include details of the environment this PR was developed in (language/platform/browser version).

    • [ ] This change adds test coverage for new/changed/fixed functionality

    Checklist

    • [ ] I have added documentation for new/changed functionality in this PR and in github.com/otterize/docs
  • 10

    Update README.md

    Please see the contributing guidelines for how to create and submit a high-quality PR for this repo. This template is based on Auth0's excellent template.

    Description

    Describe the purpose of this PR along with any background information and the impacts of the proposed change. For the benefit of the community, please do not assume prior context.

    Provide details that support your chosen implementation, including: breaking changes, alternatives considered, changes to the API, etc.

    References

    Include any links supporting this change such as a:

    • GitHub Issue/PR number addressed or fixed
    • StackOverflow post
    • Related pull requests/issues from other repos

    If there are no references, simply delete this section.

    Testing

    Describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

    Please include any manual steps for testing end-to-end or functionality not covered by unit/integration tests.

    Also include details of the environment this PR was developed in (language/platform/browser version).

    • [ ] This change adds test coverage for new/changed/fixed functionality

    Checklist

    • [ ] I have added documentation for new/changed functionality in this PR and in github.com/otterize/docs
  • 11

    Output-type dir should require output flag be present and specify a dir, or return an error

    Currently, if --output-type dir is specified but --output (or -o) is missing, the --output-type flag is silently ignored, so the command acts as though --output-type single-file were specified.

    Instead, if --output-type dir is specified, then --output (or -o) should be required with a value that resolves to a directory, or else an error should be returned explaining that --output-type dir requires specifying an output directory with the -o or --output flag.

  • 12

    Support multiple orgs per user - invites, log-in and operations

    This PR adds functionality in the CLI to support multiple orgs per user in Otterize Cloud. Previously, there was just one org. The CLI now asks the user which org they would like to use if there are multiple orgs, and can select which org to query after log-in.