Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

PowerScale OneFS API Reference

PDF

JSON query format

You can apply the following JSON query format to refine your search.

The query is defined in the following format, in Backus-Naur Form (BNF) style.

query = <scope_query> |
{
   "result":<attribute_list>,
   "scope":<scope_query>
}scope_query = predicate |{
   "logic":"<logic_operator>",
   "conditions":[
      <condition>
   ]
}

The attribute_list is an array of attribute names, which include system attributes and user-defined attributes. For example:

["name", "last_modified", "user.color"]

In the results, the user-defined attribute is prefixed with "user."

The only logical operators that are supported are "and", "or", and "not", where "not" is an unary operator and only one condition is valid. The "not" operator negates the condition that is evaluated in the conditions parameter. You must specify two or more conditions for the "and" and "or" operators in the conditions parameter.

logic_operator = and|or|not

The conditions parameter includes an array of conditions. Each condition is defined as follows:

condition = scope_query|predicate

The predicate value is defined as follows:

predicate =
{
   "operator":"<comparison_operator>",
   "attr":"attr_name",
   "value":"attr_value"   | string_array
}

The <comparison_operator> value can be any of the following operators: =, !=, <, <=, >, >=, like, or in.

The arithmetic comparison operators are self-explanatory. The "like" operator matches the specified attribute with a pattern of regular expressions. For example, the following JSON query returns all objects with the attribute "Model" prefixed with "T75":

{
   "operator":"like",
   "attr":"user.Model",
   "value":"^T75.*"
}

If the operator is set to "in", the value must be an array of strings, with at least one element in the array. When only one element is in the array, the "in" operator behaves the same way as the "=" operator. For example, the following query returns objects with the attribute "color" set to either "blue", "green", or "turquoise":

{
   "operator":"in",
   "attr":"user.color",
   "value":[
      "blue",
      "green",
      "turquoise"
   ]
}

The attribute name can be the name of a user-defined attribute or one of the system defined attributes, such as:

"name" : file or directory name
"size" : the object size in bytes
"last_modified" : last modified date
"content_type" : content type
"container" : the container name
"container_path" : the container full path
"owner": the owner of the object

If the attribute is the user-defined attribute, the attribute must be prefixed with "user." to differentiate the attribute from a system attribute with the same name. For example, if there is a user-defined attribute that is called "name", you should write the attribute as "user.name."

Multiple query predicates can be combined through logical operators. For example, the following query returns objects that satisfy one of the following conditions: "Model" is prefixed with T75 or the "color" attribute is either "red," "green," or "turquoise," or the "manufacture" attribute is ACME.

{
   "logic":"or",
   "conditions":[
      {
         "operator":"like",
         "attr":"user.Model",
         "value":"^T75.*"
      },
      {
         "operator":"in",
         "attr":"user.color",
         "value":[
            "red",
            "green",
            "turquoise"
         ]
      },
      {
         "operator":"=",
         "attr":"user.manufacture",
         "value":"ACME"
      }
   ]
}

Instead of basic predicates, the element of the conditions array can be a subquery, which allows more complex queries. For example, the following query returns objects in which either the attribute "manufacture" is set to "ACME" or the "model" attribute is set to "T750," and the "color" attribute is set to "black."

{
   "logic":"or",
   "conditions":[
      {
         "operator":"=",
         "attr":"user.manufacture",
         "value":"ACME"
      },
      {
         "logic":"and",
         "conditions":[
            {
               "operator":"=",
               "attr":"user.model",
               "value":"T750"
            },
            {
               "operator":"=",
               "attr":"user.color",
               "value":"black"
            }
         ]
      }
   ]
}

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\