Giter Site home page Giter Site logo

azure-query's Introduction

Azure Query

This is both a python library and CLI tool that can be used to query the Microsft Graph REST API v1.0. It can be used as a CLI to construct calls that directly map to a single call to the Graph API, and receive the JSON response. It can also be used as a library to create your own utilities if you have more complex use cases.

Overview

The tool utilizes a local web browser to perform an OAuth challenge and retrieve an access token. This makes the flow interactive by default. It caches the access token under $HOME/.aq/token for future calls while the token is still valid.

Currently the tool is only supported on OSX and requires Python 3.

Usage

The CLI command aq is used to make calls out to the Graph API. It currently only support GET operations. It is a straight passthrough to the endpoint found in the Microsoft Graph API v1.0 reference.

The CLI also supports the OData Query Options via CLI flags.

Example:

$ aq get /users --filter "startsWith(displayName,'Example')"
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
    "value": [
        {
            "businessPhones": [],
            "displayName": "Example1 User",
            "givenName": null,
            "jobTitle": null,
            "mail": null,
            "mobilePhone": null,
            "officeLocation": null,
            "preferredLanguage": null,
            "surname": null,
            "userPrincipalName": "[email protected]",
            "id": "2ba42c9f-2055-45ce-9cd1-5b4244809bb1"
        },
        {
            "businessPhones": [],
            "displayName": "Example2 User",
            "givenName": null,
            "jobTitle": null,
            "mail": null,
            "mobilePhone": null,
            "officeLocation": null,
            "preferredLanguage": null,
            "surname": null,
            "userPrincipalName": "[email protected]",
            "id": "3c78c8dd-5b27-4f63-f894-54e971f313e3"
        }
    ]
}

azure-query's People

Contributors

jjulien avatar

Stargazers

Brian Vanderbusch avatar

Watchers

James Cloos avatar  avatar Nicholas Shine avatar  avatar

Forkers

nickshine

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.