uac-cli


Nameuac-cli JSON
Version 0.2.7 PyPI version JSON
download
home_pageNone
SummaryA CLI tool for executing commands against the Stonebranch UAC API
upload_time2024-05-13 18:27:24
maintainerNone
docs_urlNone
authorHuseyin G.
requires_python>=3.7
licenseCC BY-NC 4.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # UAC-CLI: CLI for managing Stonebranch - UAC

## Overview

UAC CLI is a command-line interface tool designed to interact with the Universal Controller API. It provides a comprehensive set of commands for managing resources such as audits, agent clusters, agents, bundles, business services, calendars, cluster nodes, credentials, custom days, database connections, email connections, LDAP configurations, metrics, OAuth clients, OMS servers, PeopleSoft connections, promotion targets, properties, reports, SAP connections, scripts, server operations, simulations, system status, task instances, tasks, triggers, universal events, universal templates, user groups, users, variables, virtual resources, webhooks, and workflows.

Go to the documentation site to [read the Docs](https://uac-cli.readthedocs.io/en/latest/index.html).

## Features

- **Environment Configuration**: Automatically loads environment variables from a `.env` file to simplify configuration management.
- **Logging**: Supports various log levels (DEBUG, INFO, WARNING, ERROR, CRITICAL) to aid in debugging and operational monitoring.
- **Output**: Allows users to specify output file paths for writing the output to .json files.
- **Selective Field Return**: Supports JSONPath expressions to select specific fields from JSON responses for output.
- **Input from Files**: Enables specifying input parameters from files, facilitating complex operations that require detailed configurations.
- **Ignore IDs**: Offers an option to ignore sysIDs in payloads, streamlining the creation of new resources without manual ID removal.

## Installation

Before installing UAC CLI, ensure you have Python installed on your system. It's recommended to use Python 3.6 or higher.

```bash
pip install uac-cli
```

## Configuration

Run the init command so that it will create a profile file for you. Default profile name is 'default'
```bash
uac config init 
```
```   
Please enter UAC URL []: https://atlanta.stonebranchdev.cloud/
Do you use personal access token? [Y/n]: 
Please enter personal access token []: <token>
Config file written. (Path: /Users/user/.uac/profiles.yml)
```

### Adding new profile
Run the config add-profile command and follow the steps

### Using a profile
Use --profile or -p option

```bash
uac -p dev system get
```
or use environment variables
```bash
export UAC_PROFILE=dev
uac system get
```

## Usage

The UAC CLI tool is invoked using the `uac` command followed by subcommands and options. Here's the basic syntax:

```bash
uac [OPTIONS] COMMAND [ARGS]...
```

### Global Options

- `--log-level, -l`: Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL).
- `--help`: Show the help message and exit.
- `--profile, -p`: Change profile

### Examples

### Listing Audits and Agent Clusters

```bash
#!/bin/bash

# List all audits and output the result to a JSON file
uac audit list -o result.json

# List all agent clusters and output the result to a JSON file
uac agent-cluster list -o result.json
```

### Working with Agent Clusters

```bash
# List all agent clusters and get the name of the first one
CLUSTER=$(uac agent-cluster list --select "[0].name")

# Get details of the first agent cluster and output to a file
uac agent-cluster get agent_cluster_name="$CLUSTER" -o agent_cluster.json

# Update the agent cluster using the modified JSON file
uac agent-cluster update --input agent_cluster.json

# Create a new agent cluster using the configuration from the file
uac agent-cluster create --input agent_cluster.json name="Huseyin Agent Cluster2" --ignore-ids

# Delete the newly created agent cluster
uac agent-cluster delete agentclustername="Huseyin Agent Cluster2"

# Show the name of the first agent cluster
uac agent-cluster list_advanced agent_cluster_name="${CLUSTER}" -s "$.[0].name"

# Show queue name of the first agent cluster
uac agent-cluster get_selected_agent agent_cluster_name="${CLUSTER}" -s "$.queueName"

# Suspend and then resume the first agent cluster
uac agent-cluster suspend agent_cluster_name="${CLUSTER}"
uac agent-cluster resume agent_cluster_name="${CLUSTER}"

# Set the task execution limit for the first agent cluster
uac agent-cluster set_task_execution_limit agent_cluster_name="${CLUSTER}" limit_amount=10 limit_type=limited
uac agent-cluster set_task_execution_limit agent_cluster_name="${CLUSTER}" limit_type=unlimited

# Resolve the network alias for the first agent cluster
uac agent-cluster resolve_cluster agent_cluster_name="${CLUSTER}"
```

### Managing Business Services

```bash
# List all business services and output to a file
uac business-service list -o business_service.json

# Get the last business service's name
BS=$(uac business-service list -s "$.[-1].name")

# Get details of the last business service and output to a file
uac business-service get busservicename=$BS -o bs.json

# Update the business service with a new description
uac business-service update -i bs.json description="updated"

# Create a new business service based on the existing one
uac business-service create -i bs.json name="READONLY2" --ignore-ids

# Delete the newly created business service
uac business-service delete busservicename=READONLY2
```

### Working with Credentials

```bash
# List the last credential's name and set it to a variable
CRED=$(uac credential list -s "$.[-1].name")

# Get details of the last credential and output to a file
uac credential get credentialname="$CRED" -o cred.json

# Update the credential with a new description
uac credential update -i cred.json description="Updated"

# Create a new credential based on the existing one
uac credential create -i cred.json name="dummy2" --ignore-ids

# Delete the newly created credential
uac credential delete credentialid=875b52ee17344a27996c85738b4be14a

# Change the runtime password of the credential
uac credential change_password name=$CRED new_runtime_password=dummy

# Test the provider for the credential
uac -l DEBUG credential test_provider credentialname=dummy
```

### Generating and Managing Metrics

```bash
# Get metrics and output to a JSON file
uac metrics get -o result.json

# Get metrics and filter for a specific metric
uac metrics get | grep -i process_virtual_memory_bytes
```

### Obtaining System Information

```bash
# Get system information and select the memoryFree field
uac system get -s "$.memoryFree"
```

#### Listing All Agents

```bash
uac agent list
```

#### Creating a New Agent Cluster

```bash
uac agent_cluster create --input agent_cluster_config.json --ignore-ids
```

#### Running a Report

```bash
# download PDF file
uac report run_report report_title="Active Tasks" --format pdf --output report_output.pdf
# download the report in different formats
uac report run_report report_title="Active Tasks" --format json
uac report run_report report_title="Active Tasks" --format tab
uac report run_report report_title="Active Tasks" --format csv
uac report run_report report_title="Active Tasks" --format xml
```

## Development

To contribute to the UAC CLI tool, clone the repository, make your changes, and submit a pull request. Ensure you follow the project's coding standards and update tests as necessary.

## Support

For issues, questions, or contributions, please submit an issue or pull request on the project's GitHub page.

# Contributing
We welcome contributions! Please refer to our Contributing Guide for details on how to submit pull requests, propose bug fixes and improvements, and how to build and test your changes to this project.

# License

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).

### What this means

The CC BY-NC 4.0 License allows others to remix, adapt, and build upon the work non-commercially, as long as they credit the creator and license their new creations under the identical terms.

### Full Legal Code

You can read the full legal code of the license [here](https://creativecommons.org/licenses/by-nc/4.0/legalcode).

### Summary of the License

This summary is a quick guide to the key elements of the full license, which is legally binding:

- **Attribution:** You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

- **NonCommercial:** You may not use the material for commercial purposes.

- **ShareAlike:** If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

- **No additional restrictions:** You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

For more information about what you can and can't do under this license, please review the license code and summary at the provided link.

# Disclaimer
This package is not officially affiliated with Stonebranch, Inc. It is a community-driven project aimed at simplifying the use of Stonebranch UAC APIs.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "uac-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Huseyin G.",
    "author_email": "\"Huseyin G.\" <huseyim@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/12/73/1ce88f5ff0310f766d0045368520f34f00ecbfcedf591e03cd34c414a163/uac-cli-0.2.7.tar.gz",
    "platform": null,
    "description": "# UAC-CLI: CLI for managing Stonebranch - UAC\n\n## Overview\n\nUAC CLI is a command-line interface tool designed to interact with the Universal Controller API. It provides a comprehensive set of commands for managing resources such as audits, agent clusters, agents, bundles, business services, calendars, cluster nodes, credentials, custom days, database connections, email connections, LDAP configurations, metrics, OAuth clients, OMS servers, PeopleSoft connections, promotion targets, properties, reports, SAP connections, scripts, server operations, simulations, system status, task instances, tasks, triggers, universal events, universal templates, user groups, users, variables, virtual resources, webhooks, and workflows.\n\nGo to the documentation site to [read the Docs](https://uac-cli.readthedocs.io/en/latest/index.html).\n\n## Features\n\n- **Environment Configuration**: Automatically loads environment variables from a `.env` file to simplify configuration management.\n- **Logging**: Supports various log levels (DEBUG, INFO, WARNING, ERROR, CRITICAL) to aid in debugging and operational monitoring.\n- **Output**: Allows users to specify output file paths for writing the output to .json files.\n- **Selective Field Return**: Supports JSONPath expressions to select specific fields from JSON responses for output.\n- **Input from Files**: Enables specifying input parameters from files, facilitating complex operations that require detailed configurations.\n- **Ignore IDs**: Offers an option to ignore sysIDs in payloads, streamlining the creation of new resources without manual ID removal.\n\n## Installation\n\nBefore installing UAC CLI, ensure you have Python installed on your system. It's recommended to use Python 3.6 or higher.\n\n```bash\npip install uac-cli\n```\n\n## Configuration\n\nRun the init command so that it will create a profile file for you. Default profile name is 'default'\n```bash\nuac config init \n```\n```   \nPlease enter UAC URL []: https://atlanta.stonebranchdev.cloud/\nDo you use personal access token? [Y/n]: \nPlease enter personal access token []: <token>\nConfig file written. (Path: /Users/user/.uac/profiles.yml)\n```\n\n### Adding new profile\nRun the config add-profile command and follow the steps\n\n### Using a profile\nUse --profile or -p option\n\n```bash\nuac -p dev system get\n```\nor use environment variables\n```bash\nexport UAC_PROFILE=dev\nuac system get\n```\n\n## Usage\n\nThe UAC CLI tool is invoked using the `uac` command followed by subcommands and options. Here's the basic syntax:\n\n```bash\nuac [OPTIONS] COMMAND [ARGS]...\n```\n\n### Global Options\n\n- `--log-level, -l`: Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL).\n- `--help`: Show the help message and exit.\n- `--profile, -p`: Change profile\n\n### Examples\n\n### Listing Audits and Agent Clusters\n\n```bash\n#!/bin/bash\n\n# List all audits and output the result to a JSON file\nuac audit list -o result.json\n\n# List all agent clusters and output the result to a JSON file\nuac agent-cluster list -o result.json\n```\n\n### Working with Agent Clusters\n\n```bash\n# List all agent clusters and get the name of the first one\nCLUSTER=$(uac agent-cluster list --select \"[0].name\")\n\n# Get details of the first agent cluster and output to a file\nuac agent-cluster get agent_cluster_name=\"$CLUSTER\" -o agent_cluster.json\n\n# Update the agent cluster using the modified JSON file\nuac agent-cluster update --input agent_cluster.json\n\n# Create a new agent cluster using the configuration from the file\nuac agent-cluster create --input agent_cluster.json name=\"Huseyin Agent Cluster2\" --ignore-ids\n\n# Delete the newly created agent cluster\nuac agent-cluster delete agentclustername=\"Huseyin Agent Cluster2\"\n\n# Show the name of the first agent cluster\nuac agent-cluster list_advanced agent_cluster_name=\"${CLUSTER}\" -s \"$.[0].name\"\n\n# Show queue name of the first agent cluster\nuac agent-cluster get_selected_agent agent_cluster_name=\"${CLUSTER}\" -s \"$.queueName\"\n\n# Suspend and then resume the first agent cluster\nuac agent-cluster suspend agent_cluster_name=\"${CLUSTER}\"\nuac agent-cluster resume agent_cluster_name=\"${CLUSTER}\"\n\n# Set the task execution limit for the first agent cluster\nuac agent-cluster set_task_execution_limit agent_cluster_name=\"${CLUSTER}\" limit_amount=10 limit_type=limited\nuac agent-cluster set_task_execution_limit agent_cluster_name=\"${CLUSTER}\" limit_type=unlimited\n\n# Resolve the network alias for the first agent cluster\nuac agent-cluster resolve_cluster agent_cluster_name=\"${CLUSTER}\"\n```\n\n### Managing Business Services\n\n```bash\n# List all business services and output to a file\nuac business-service list -o business_service.json\n\n# Get the last business service's name\nBS=$(uac business-service list -s \"$.[-1].name\")\n\n# Get details of the last business service and output to a file\nuac business-service get busservicename=$BS -o bs.json\n\n# Update the business service with a new description\nuac business-service update -i bs.json description=\"updated\"\n\n# Create a new business service based on the existing one\nuac business-service create -i bs.json name=\"READONLY2\" --ignore-ids\n\n# Delete the newly created business service\nuac business-service delete busservicename=READONLY2\n```\n\n### Working with Credentials\n\n```bash\n# List the last credential's name and set it to a variable\nCRED=$(uac credential list -s \"$.[-1].name\")\n\n# Get details of the last credential and output to a file\nuac credential get credentialname=\"$CRED\" -o cred.json\n\n# Update the credential with a new description\nuac credential update -i cred.json description=\"Updated\"\n\n# Create a new credential based on the existing one\nuac credential create -i cred.json name=\"dummy2\" --ignore-ids\n\n# Delete the newly created credential\nuac credential delete credentialid=875b52ee17344a27996c85738b4be14a\n\n# Change the runtime password of the credential\nuac credential change_password name=$CRED new_runtime_password=dummy\n\n# Test the provider for the credential\nuac -l DEBUG credential test_provider credentialname=dummy\n```\n\n### Generating and Managing Metrics\n\n```bash\n# Get metrics and output to a JSON file\nuac metrics get -o result.json\n\n# Get metrics and filter for a specific metric\nuac metrics get | grep -i process_virtual_memory_bytes\n```\n\n### Obtaining System Information\n\n```bash\n# Get system information and select the memoryFree field\nuac system get -s \"$.memoryFree\"\n```\n\n#### Listing All Agents\n\n```bash\nuac agent list\n```\n\n#### Creating a New Agent Cluster\n\n```bash\nuac agent_cluster create --input agent_cluster_config.json --ignore-ids\n```\n\n#### Running a Report\n\n```bash\n# download PDF file\nuac report run_report report_title=\"Active Tasks\" --format pdf --output report_output.pdf\n# download the report in different formats\nuac report run_report report_title=\"Active Tasks\" --format json\nuac report run_report report_title=\"Active Tasks\" --format tab\nuac report run_report report_title=\"Active Tasks\" --format csv\nuac report run_report report_title=\"Active Tasks\" --format xml\n```\n\n## Development\n\nTo contribute to the UAC CLI tool, clone the repository, make your changes, and submit a pull request. Ensure you follow the project's coding standards and update tests as necessary.\n\n## Support\n\nFor issues, questions, or contributions, please submit an issue or pull request on the project's GitHub page.\n\n# Contributing\nWe welcome contributions! Please refer to our Contributing Guide for details on how to submit pull requests, propose bug fixes and improvements, and how to build and test your changes to this project.\n\n# License\n\nThis project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).\n\n### What this means\n\nThe CC BY-NC 4.0 License allows others to remix, adapt, and build upon the work non-commercially, as long as they credit the creator and license their new creations under the identical terms.\n\n### Full Legal Code\n\nYou can read the full legal code of the license [here](https://creativecommons.org/licenses/by-nc/4.0/legalcode).\n\n### Summary of the License\n\nThis summary is a quick guide to the key elements of the full license, which is legally binding:\n\n- **Attribution:** You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.\n\n- **NonCommercial:** You may not use the material for commercial purposes.\n\n- **ShareAlike:** If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.\n\n- **No additional restrictions:** You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.\n\nFor more information about what you can and can't do under this license, please review the license code and summary at the provided link.\n\n# Disclaimer\nThis package is not officially affiliated with Stonebranch, Inc. It is a community-driven project aimed at simplifying the use of Stonebranch UAC APIs.\n",
    "bugtrack_url": null,
    "license": "CC BY-NC 4.0",
    "summary": "A CLI tool for executing commands against the Stonebranch UAC API",
    "version": "0.2.7",
    "project_urls": {
        "Documentation": "https://uac-cli.readthedocs.io/en/latest/index.html",
        "Homepage": "https://github.com/gomleksiz/uac-cli",
        "Issues": "https://github.com/gomleksiz/uac-cli/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9a6d3864355652d921a32198e149e6304a0964b989c06f48a7482cf81b27f6b",
                "md5": "7d40e657a2bd6c360e1812960d262448",
                "sha256": "60a8e1db8799f645e188f6bc67558bf3df74c603b89e9f04f99195a50d1d90f9"
            },
            "downloads": -1,
            "filename": "uac_cli-0.2.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d40e657a2bd6c360e1812960d262448",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 43121,
            "upload_time": "2024-05-13T18:27:22",
            "upload_time_iso_8601": "2024-05-13T18:27:22.658571Z",
            "url": "https://files.pythonhosted.org/packages/e9/a6/d3864355652d921a32198e149e6304a0964b989c06f48a7482cf81b27f6b/uac_cli-0.2.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12731ce88f5ff0310f766d0045368520f34f00ecbfcedf591e03cd34c414a163",
                "md5": "4e6b3c11a68a4b7b0a475fc271624018",
                "sha256": "8a36ac731fe92c86654332981af9ee2229c7e2ad7349b75c2db836fe67094b7b"
            },
            "downloads": -1,
            "filename": "uac-cli-0.2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "4e6b3c11a68a4b7b0a475fc271624018",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 28264,
            "upload_time": "2024-05-13T18:27:24",
            "upload_time_iso_8601": "2024-05-13T18:27:24.397832Z",
            "url": "https://files.pythonhosted.org/packages/12/73/1ce88f5ff0310f766d0045368520f34f00ecbfcedf591e03cd34c414a163/uac-cli-0.2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-13 18:27:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gomleksiz",
    "github_project": "uac-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "uac-cli"
}
        
Elapsed time: 0.27326s