Giter Club home page Giter Club logo

simple-bpms's Introduction

platform device language
windows, Android, iOS
desktop, phone, tablet
csharp, json

Device Management Query Sample Snippets


Table of Contents

Introduction

About this document

This document contains sample JSON snippets for various device and job queries that can be performed via the Device Management public preview APIs.

Note that for csharp the snippets have to be modified to escape all the double quote characters. This is as simple as pasting in the cs code file and replacing every double quote character with two double quotes instead of one. I.e, " -> ""

Device Queries

Filter over a Device Property

Get all devices where the FirmwareVersion Device property is set to 1.0

{
    "filter": {
        "property": {
            "name": "FirmwareVersion",
            "type": "device"
        },
        "value": "1.0",
        "comparisonOperator": "eq",
        "type": "comparison"
    }
}

Filter over a Device property (not-equals)

Get all devices where the FirmwareVersion Device property is not set to 1.0

{
    "filter": {
        "property": {
            "name": "FirmwareVersion",
            "type": "device"
        },
        "value": "1.0",
        "comparisonOperator": "ne",
        "type": "comparison"
    }
}

Filter over a Service property

Get all devices where CustomerId Service property is set to 123456

{
    "filter": {
        "property": {
            "name": "CustomerId",
            "type": "service"
        },
        "value": "123456",
        "comparisonOperator": "eq",
        "type": "comparison"
    }
}

Filter over a Service property with aggregates

Group by the CustomerId Service prooperty and get sum of Weight Service property for all devices where CustomerId Service property is present.

{
    "filter": {
        "property": {
            "name": "CustomerId",
            "type": "service"
        },
        "value": null,
        "comparisonOperator": "ne",
        "type": "comparison"
    },
    "aggregate": {
        "keys": [
            {
                "name": "CustomerId",
                "type": "service"
            }
        ],
        "properties": [
            {
                "operator": "sum",
                "property": {
                    "name": "Weight",
                    "type": "service"
                },
                "columnName": "TotalWeight"
            }
        ]
    },
    "sort": []
}

Order-by

Return all devices ordered by the QoS Service property.

{
    "sort": [
        {
            "property": {
                "name": "QoS",
                "type": "service"
            },
            "order": "asc"
        }
    ]
}

Device Job Queries

Filter jobs by status

Get all device jobs where status of the job is set to Running.

{
    "filter": {
        "property": {
            "name": "Status",
            "type": "default"
        },
        "value": "Running",
        "comparisonOperator": "eq",
        "type": "comparison"
    }
}

Order jobs by start time

Get all device jobs ordered by StartTimeUtc

{
    "sort": [
        {
            "property": {
                "name": "StartTimeUtc",
                "type": "default"
            },
            "order": "desc"
        }
    ]
}

simple-bpms's People

Contributors

affandar avatar samarabbas avatar

Watchers

 avatar  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.