GithubHelp home page GithubHelp logo

isabella232 / genesyscloud-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from purecloudlabs/genesyscloud-cli

0.0 0.0 0.0 16 KB

CLI tool to interact with Genesys Cloud APIs.

License: MIT License

Python 100.00%

genesyscloud-cli's Introduction

Genesys Cloud CLI

โš  WARNING: This is a result of a hackathon project and while it is functional it is not officially supported by the Genesys Development Group.

The Genesys Cloud cli is a tool to interact with Genesys Cloud

Note that if you us oh-my-zsh, it aliases gc to a git command, this cli works using either gc or gcli if you are using that alias.

Running locally

$ virtualenv venv
$ . venv/bin/activate
$ pip install --editable .

Local setup

The cli authenticates using client credentials which you will have to create yourself

gc profile new is the easiest way to setup your credentials. This will create a credentials file at ~/.genesyscloud/credentials and can support multiple profiles for different organizations.

$ gc profile new
Profile Name [DEFAULT]: mycompanyname
Genesys Cloud Environment (mypurecloud.com, usw2.pure.cloud): mypurecloud.com
OAuth Client ID: dfbdc514-e830-4745-bffa-1cb7ee7f2736
OAuth Client Secret: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

Profiles

With multiple profiles configured, you can either specify one when connnecting:

$ gc --profile <profilename> <command>

Or switch a named profile to the default

$ gc profile setdefault <profilename>

Configuration Options

~/.genesyscloud/config contains configurable options in the DEFAULT section

[DEFAULT]
output_type = yaml

Command Structure

The Genesys Cloud cli uses a multipart structure

$ gc <command> <subcommand> [options and params]

Pagination

For resources that have multiple pages such as listing users, there are options available on how to process the pages. By default the cli uses a page size of 250 and retrieves all items.

--page-size    # set a page size other than 250
--page-number   # return a specific page

Data Inputs

Some commands require bodies to be sent with the request, such as creating a new user. The body can be supplied a number of ways.

  1. Passing json with the command (escaped whitespace is not currently supported)

    $ gc users new "{\"name":\"Joe Smith\"}"
    
  2. Referencing a file

    $ gc users new user.json
    
  3. Stream input

    $ gc users new < user.json
    
    $ echo "{\"name":\"Joe Smith\"}" | gc user new
    

genesyscloud-cli's People

Contributors

carnellj avatar inindevevangelists avatar

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.