Skip to content

Latest commit

 

History

History
146 lines (102 loc) · 5.77 KB

File metadata and controls

146 lines (102 loc) · 5.77 KB

TypesApi

All URIs are relative to http://orion.lab.fiware.org

Method HTTP request Description
listEntityTypes GET /v2/types/ List Entity Types
retrieveEntityType GET /v2/types/{entityType} Retrieve entity type

listEntityTypes

List<ListEntityTypesResponse> listEntityTypes(limit, offset, options)

List Entity Types

If the `values` option is not in use, this operation returns a JSON array with the entity types. Each element is a JSON object with information about the type: * `type` : the entity type name. * `attrs` : the set of attribute names along with all the entities of such type, represented in a JSON object whose keys are the attribute names and whose values contain information of such attributes (in particular a list of the types used by attributes with that name along with all the entities). * `count` : the number of entities belonging to that type. If the `values` option is used, the operation returns a JSON array with a list of entity type names as strings. Results are ordered by entity `type` in alphabetical order. Response code: * Successful operation uses 200 OK * Errors use a non-2xx and (optionally) an error payload. See subsection on &quot;Error Responses&quot; for more details.

Example

// Import classes:
import city.makeour.ngsi.v2.invoker.ApiClient;
import city.makeour.ngsi.v2.invoker.ApiException;
import city.makeour.ngsi.v2.invoker.Configuration;
import city.makeour.ngsi.v2.invoker.models.*;
import city.makeour.ngsi.v2.api.TypesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("http://orion.lab.fiware.org");

        TypesApi apiInstance = new TypesApi(defaultClient);
        Double limit = 3.4D; // Double | Limit the number of types to be retrieved.
        Double offset = 3.4D; // Double | Skip a number of records.
        String options = "count"; // String | Options dictionary.
        try {
            List<ListEntityTypesResponse> result = apiInstance.listEntityTypes(limit, offset, options);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TypesApi#listEntityTypes");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
limit Double Limit the number of types to be retrieved. [optional]
offset Double Skip a number of records. [optional]
options String Options dictionary. [optional] [enum: count, values]

Return type

List<ListEntityTypesResponse>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

retrieveEntityType

RetrieveEntityTypeResponse retrieveEntityType(entityType)

Retrieve entity type

This operation returns a JSON object with information about the type: * `attrs` : the set of attribute names along with all the entities of such type, represented in a JSON object whose keys are the attribute names and whose values contain information of such attributes (in particular a list of the types used by attributes with that name along with all the entities). * `count` : the number of entities belonging to that type. Response code: * Successful operation uses 200 OK * Errors use a non-2xx and (optionally) an error payload. See subsection on &quot;Error Responses&quot; for more details.

Example

// Import classes:
import city.makeour.ngsi.v2.invoker.ApiClient;
import city.makeour.ngsi.v2.invoker.ApiException;
import city.makeour.ngsi.v2.invoker.Configuration;
import city.makeour.ngsi.v2.invoker.models.*;
import city.makeour.ngsi.v2.api.TypesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("http://orion.lab.fiware.org");

        TypesApi apiInstance = new TypesApi(defaultClient);
        String entityType = "entityType_example"; // String | Entity Type
        try {
            RetrieveEntityTypeResponse result = apiInstance.retrieveEntityType(entityType);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TypesApi#retrieveEntityType");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
entityType String Entity Type

Return type

RetrieveEntityTypeResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -