get

Use greymatter get to retrieve a specific object and its configurations in the Grey Matter mesh. Objects can be zones, proxies, domains, routes, shared_rules, and clusters.

Usage

greymatter [GLOBAL OPTIONS] get [OPTIONS] <object type> <object key>

Sample Usage

Cluster

$ ./greymatter get cluster example-service
[info] 2019/07/10 03:31:06 Preferring --api.key for authentication
{
  "cluster_key": "example-service",
  "zone_key": "zone-default-zone",
  "name": "example-service",
  "instances": [
    {
      "host": "example-service",
      "port": 3000,
      "metadata": null
    }
  ],
  "circuit_breakers": null,
  "outlier_detection": null,
  "health_checks": null,
  "checksum": "0508a23ae92afea8b5d6a3a9e8c9b3fce60f1f5e0a76c76412fa70ddc12d9304"
}

Route

$ greymatter get route route-/
[info] 2019/07/10 03:32:15 Preferring --api.key for authentication
{
  "route_key": "route-/",
  "domain_key": "domain-*",
  "zone_key": "zone-default-zone",
  "path": "/",
  "prefix_rewrite": "/",
  "redirects": null,
  "shared_rules_key": "shared-rules-edge",
  "rules": null,
  "response_data": {},
  "cohort_seed": null,
  "retry_policy": null,
  "checksum": "19f76e8bad1fa5bd4c6408b4086fc445d6c11880dfa9a2c70e977a454e8819e9"
}

Help

To list available commands run with the global help flag, greymatter get --help:

$ greymatter get --help
NAME
    get - retrieve an object from the Grey Matter API

USAGE
    greymatter [GLOBAL OPTIONS] get [OPTIONS] <object type> <object key>

VERSION
    v1.2.1

DESCRIPTION
    object type is one of: zone, proxy, listener, domain, route, shared_rules, cluster

GLOBAL OPTIONS
    --api.header=header
            Specifies a custom header to send with every API request. Headers are given as
            name:value pairs. Leading and trailing whitespace will be stripped from the
            name and value. For multiple headers, this flag may be repeated or multiple
            headers can be delimited with commas.

    --api.host=host:port
            (default: localhost:80)
            The address (host:port) for API requests. If no port is given, it defaults to
            port 443 if --api.ssl is true and port 80 otherwise.

    --api.insecure
            (default: false)
            If true, don't validate server cert when using SSL for API requests

    --api.key=string
            (default: "none")
            [SENSITIVE] The auth key for API requests

    --api.prefix=value
            The url prefix for API requests. Forms the path part of <host>:<port><path>

    --api.ssl
            (default: true)
            If true, use SSL for API requests

    --api.sslCert=value
            Specifies the SSL cert to use for every API request.

    --api.sslKey=value
            Specifies the SSL key to use for every API request.

    --console.level=level
            (default: "info")
            (valid values: "debug", "info", "error", or "none")
            Selects the log level for console logs messages.

    --format=string
            (default: "json")
            The I/O format (json or yaml)

    --help  (default: false)
            Show a list of commands or help for one command

    --version
            (default: false)
            Print the version and exit

    Global options can also be configured via upper-case, underscore-delimited environment
    variables prefixed with "GREYMATTER_". For example, "--some-flag" becomes
    "GREYMATTER_SOME_FLAG". Command-line flags take precedence over environment variables.

OPTIONS
    --help  (default: false)
            Show a list of commands or help for one command

    --key=string
            [DEPRECATED] key of the object to retrieve

    --version
            (default: false)
            Print the version and exit

    Options can also be configured via upper-case, underscore-delimited environment
    variables prefixed with "GREYMATTER_GET_". For example, "--some-flag" becomes
    "GREYMATTER_GET_SOME_FLAG". Command-line flags take precedence over environment
    variables.

Questions?

Last updated

Was this helpful?