http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/delete_named_query.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/delete_named_query.html.md.erb b/geode-docs/rest_apps/delete_named_query.html.md.erb deleted file mode 100644 index ae109d6..0000000 --- a/geode-docs/rest_apps/delete_named_query.html.md.erb +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: DELETE /gemfire-api/v1/queries/{queryId} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Delete the specified named query. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries/{query} -``` - -## Parameters - -| Parameter | Description | Example Values | -|-----------|------------------------------------|----------------| -| {queryId} | QueryID for named query to delete. | selectOrders | - -## Example Request - -``` pre -DELETE /gemfire-api/v1/queries/selectOrders - -Accept: application/json -Content-Type: application/json -``` - -## Example Success Response - -``` pre -Response Payload: application/json - -200 OK -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|-----------------------------------------------------------------------------------------------| -| 404 NOT FOUND | Query with specified ID could not be found. | -| 500 INTERNAL SERVER ERROR | Encountered error at server. Check the HTTP response body for a stack trace of the exception. | - -
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/develop_rest_apps.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/develop_rest_apps.html.md.erb b/geode-docs/rest_apps/develop_rest_apps.html.md.erb deleted file mode 100644 index d48dcb1..0000000 --- a/geode-docs/rest_apps/develop_rest_apps.html.md.erb +++ /dev/null @@ -1,683 +0,0 @@ ---- -title: Developing REST Applications ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> -<a id="topic_lvp_cd5_m4"></a> - - -This section provides guidelines on writing REST client applications for Geode. - -You can browse, query, update and delete data stored in your Geode deployment. You can also manage and execute pre-deployed functions on Geode members. - -- **[Working with Regions](../rest_apps/develop_rest_apps.html#topic_qhs_f25_m4)** - - The Geode REST APIs provide basic CRUD (create, read, update and delete) operations for data entries stored in your regions. - -- **[Working with Queries](../rest_apps/develop_rest_apps.html#topic_fcn_g25_m4)** - - Geode supports the use of queries to extract data from its regions. Using REST APIs, you can create and execute either prepared or ad-hoc queries on Geode regions. You can also update and delete prepared queries. - -- **[Working with Functions](../rest_apps/develop_rest_apps.html#topic_rbc_h25_m4)** - - Geode REST APIs support the discovery and execution of predefined Geode functions on your cluster deployments. - -## <a id="topic_qhs_f25_m4" class="no-quick-link"></a>Working with Regions - -The Geode REST APIs provide basic CRUD (create, read, update and delete) operations for data entries stored in your regions. - -Regions are the resources of the Geode REST API. Each region represents a resource or a collection of resources. - -You cannot create or delete the regions themselves with the REST APIs, but you can work with the data stored within predefined Geode regions. Use the [gfsh](../tools_modules/gfsh/chapter_overview.html) command utility to add, configure or delete regions in your Geode deployment. Any additions or modifications to regions made through `gfsh` are then accessible by the REST APIs. - -## Listing Available Regions - -The main resource endpoint to the Geode API is [GET /gemfire-api/v1](get_regions.html#topic_itv_mg5_m4). Use this endpoint to discover which regions are available in your cluster. - -Example call: - -``` pre -curl -i http://localhost:7070/gemfire-api/v1 -``` - -Example response: - -``` pre -Accept: application/json -Response Payload: application/json - -200 OK -Server: Apache-Coyote/1.1 -Location: http://localhost:7070/gemfire-api/v1 -Content-Type: application/json -Transfer-Encoding: chunked -Date: Sat, 18 Jan 2014 20:05:47 GMT -{ - "regions": [ - { - "name": "customers", - "type": "REPLICATE", - "key-constraint": "java.lang.String", - "value-constraint": "org.apache.geode.pdx.PdxInstance" - }, - { - "name": "items", - "type": "REPLICATE", - "key-constraint": null, - "value-constraint": null - }, - { - "name": "orders", - "type": "PARTITION", - "key-constraint": null, - "value-constraint": null - }, - { - "name": "primitiveKVStore", - "type": "PARTITION", - "key-constraint": null, - "value-constraint": null - }, - { - "name": "empty_region", - "type": "EMPTY", - "key-constraint": "java.lang.String", - "value-constraint": "org.apache.geode.pdx.PdxInstance" - } - ] -} -``` - -Each region listed in the response includes the following region attributes: - -- **name**. Name of the region. -- **type**. Type of region. For example, REPLICATE, PARTITION, or EMPTY. See [Region Types](../developing/region_options/region_types.html#region_types) for more information. -- **key-constraint**. If defined, the fully qualified class name of the key's type. Otherwise, null. -- **value-constraint**. If defined, the fully qualified class name of the value's type. Otherwise, null. - -If no resources (regions) are available in the cluster, the call returns a 404 NOT FOUND error. - -## Reading Region Data - -You can read data from a region by using any of the following REST-enabled mechanisms: - -- **GET /gemfire-api/v1/{region}?limit=ALL** - Read all entries in a region -- **GET /gemfire-api/v1/{region}?limit=*N*** - Read a limited number of entries in a region -- **GET /gemfire-api/v1/{region}/keys** - List all keys in a region -- **GET /gemfire-api/v1/{region}/{keys}** - Read data for specific key or keys in a region - -**Reading Entries** - -To read entries in a region, use the following REST endpoint: - -``` pre -GET /gemfire-api/v1/{region}?[limit={<number>|ALL}] -``` - -For example: - -``` pre -http://localhost:7070/gemfire-api/v1/items -``` - -To read all entries in the region, specify instead: - -``` pre -http://localhost:7070/gemfire-api/v1/items?limit=ALL -``` - -To read 80 entries from the region, specify: - -``` pre -http://localhost:7070/gemfire-api/v1/items?limit=80 -``` - -Setting the limit parameter is optional. If you do not specify a limit, the request will return 50 results by default. The returned order of the results is not guaranteed; however, the response values (JSON) are specified in the same order as the list of comma-separated keys returned in the "Content-location" header. - -**Reading Keys** - -To list all keys in a region, use the following endpoint: - -``` pre -/gemfire-api/v1/{region}/keys -``` - -For example: - -``` pre -http://localhost:7070/gemfire-api/v1/items/keys -``` - -You can use the returned key to perform additional operations on the keys such as read, update or delete their values. - -**Reading Entries By Key** - -To obtain data for a specific key or set of keys, use the following endpoints: - -``` pre -GET /gemfire-api/v1/{region}/{key1} -``` - -or - -``` pre -GET /gemfire-api/v1/{region}/{key1},{key2},...,{keyN} -``` - -where you specify keys in a comma-delimited list. - -For example: - -``` pre -http://localhost:7070/gemfire-api/v1/items/1 - -http://localhost:7070/gemfire-api/v1/items/1,3,5 -``` - -If one or more of the keys you provide in the list of keys is missing from the region, you will receive a 400 BAD STATUS error response. - -If you are providing multiple keys, you can also use the `ignoreMissingKey=true` parameter to prevent 400 errors. Any non-existing keys will instead return a null response. For example: - -``` pre -http://localhost:7070/gemfire-api/v1/items/1,3,5?ignoreMissingKey=true -``` - -## Adding or Modifying Region Data - -To add data to a region, you have several options: - -- Create new a brand new entry (both key and value) in a region -- Update or insert a value for a key (if the key does not exist, it will be created) -- Update (replace) data for a key if and only if the key already exists in region -- Compare existing value for a key before replacing value -- Update or insert multiple values in the region for a set of provided keys - -**Adding entries** - -To add a new key and value to a region, you can use the following endpoint: - -``` pre -POST /gemfire-api/v1/{region}?key=<key> -``` - -This endpoint only puts the entry into the region **if the specified key does not already exist**. If the key already exists, the request will fail with a 409 CONFLICT error. - -**Note:** -If you do not specify a key for this request, a String representation of a numerical key will be generated automatically for you. - -Specify the value for the new entry in the request body. For example: - -``` pre -http://localhost:7070/gemfire-api/v1/orders?key=2 -``` - -``` pre -Request Payload: application/json -POST /gemfire-api/v1/orders?key=2 - -Accept: application/json -Content-Type: application/json -{ - "@type": "org.apache.geode.web.rest.domain.Order", - "purchaseOrderNo": 112, - "customerId": 1012, - "description": "Purchase Order for myCompany", - "orderDate": "02/10/2014", - "deliveryDate": "02/20/2014", - "contact": "John Doe", - "email": "john....@example.com", - "phone": "01-2048096", - "totalPrice": 225, - "items": [ - { - "itemNo": 1, - "description": "Product2, PartA", - "quantity": 10, - "unitPrice": 5, - "totalPrice": 50 - }, - { - "itemNo": 2, - "description": "Product2, PartB", - "quantity": 20, - "unitPrice": 20, - "totalPrice": 400 - } - ] -} -``` - -Note that in the example above, `@type` is used to declare the value-constraint for the new entry. This declaration is required to provide interoperability between Java cache clients and REST clients. - -Alternately, you can also use the following endpoint to create a new entry: - -``` pre -PUT /gemfire/v1/{region}/{key} -``` - -This endpoint will add the entry if the key does not exist. If the key already exists, the operation will update the entry. - -``` pre -http://localhost:7070/gemfire-api/v1/orders/2 -``` - -``` pre -Request Payload: application/json -PUT /gemfire-api/v1/orders/2 -Request Payload: application/json -Content-Type: application/json -Accept: application/json -{ - "@type": "org.apache.geode.web.rest.domain.Order", - "purchaseOrderNo": 1121, - "customerId": 1012, - "description": "Order for XYZ Corp", - "orderDate": "02/10/2014", - "deliveryDate": "02/20/2014", - "contact": "Pie Doe", - "email": "pie....@example.com", - "phone": "01-2048096", - "totalPrice": 225, - "items": [ - { - "itemNo": 1, - "description": "Product-100", - "quantity": 10, - "unitPrice": 5, - "totalPrice": 50 - } - ] -} -``` - -**Modifying existing entries** - -Geode provides three different options for this type of operation. To update a value for the key, you can use: - -``` pre -PUT /gemfire/v1/{region}/{key} -PUT /gemfire/v1{region}/{key}?op=REPLACE -PUT /gemfire/v1{region}/{key}?op=CAS -``` - -If you do not specify a parameter to the PUT operation, the request which will add or update the entry regardless of whether the key already exists in the region. See the example above. - -``` pre -http://localhost:7070/gemfire-api/v1/orders/2 -``` - -If you specify the op=REPLACE parameter, the request which will explicitly perform a Cache replace operation and will verify that the key exists before replacing the value. If the key does not exist in the specified region, you will receive a 404 NOT FOUND error. This operation is idempotent, meaning multiple identical requests will have the same effect as the initial request. - -``` pre -http://localhost:7070/gemfire-api/v1/orders/2?op=REPLACE -``` - -If you specify the op=CAS parameter, the value will only be replaced with the `@new` value only if the specified `@old` value matches the current value of the key in the region. If the `@old` value does not match the current value, then a 409 CONFLICT error is thrown. If you receive a 409 CONFLICT error, you can call the `GET /gemfire-api/v1/{region}/{key}` endpoint to get an updated copy of the value. This operation is not idempotent and multiple identical requests will not have the same effect as the initial request. You can use this type of REST call to achieve a similar effect as optimistic locking. - -``` pre -http://localhost:7070/gemfire-api/v1/orders/2?op=REPLACE -``` - -``` pre -Request Payload: application/json - -PUT /gemfire-api/v1/orders/2?op=CAS - -Accept: application/json -Content-Type: application/json -{ - "@old": { - "@type": "org.apache.geode.web.rest.domain.Order", - "purchaseOrderNo": 1121, - "customerId": 1012, - "description": "Order for XYZ Corp", - "orderDate": "02/10/2014", - "deliveryDate": "02/20/2014", - "contact": "Jelly Bean", - "email": "jelly.b...@example.com", - "phone": "01-2048096", - "items": [ - { - "itemNo": 1, - "description": "Product-100", - "quantity": 12, - "unitPrice": 5, - "totalPrice": 60 - } - ], - "totalPrice": 225 - }, - "@new ": { - "@type": "org.apache.geode.web.rest.domain.Order", - "purchaseOrderNo": 1121, - "customerId": 1013, - "description": "Order for New Corp", - "orderDate": "02/10/2014", - "deliveryDate": "02/25/2014", - "contact": "Vanilla Bean", - "email": "vanillab...@example.com", - "phone": "01-2048096", - "items": [ - { - "itemNo": 12345, - "description": "part 123", - "quantity": 12, - "unitPrice": 29.99, - "totalPrice": 149.95 - } - ], - "totalPrice": 149.95 - } -} -``` - -**Adding or updating multiple values for a set of keys** - -To update multiple values for keys, use: - -``` pre -PUT /gemfire-api/v1/{region}/{key1},{key2},...,{keyN} -``` - -This REST call will update any keys that already exist and insert values for any keys that do not exist in the region. - -## Deleting Region Data - -There are three options for deleting data in a region using REST APIs: - -- Delete all the data in the region -- Delete the data associated with a particular key -- Delete the data associated with a set of keys - -**Deleting all data** - -To delete all data in the region, use the following endpoint: - -``` pre -DELETE /gemfire-api/v1/{region} -``` - -For example: - -``` pre -http://localhost:7070/gemfire-api/v1/items -``` - -Note that this does not delete the region itself, but instead all the entries in the region. - -**Deleting data based on key** - -Use: - -``` pre -DELETE /gemfire-api/v1/{region}/{key} -``` - -or - -``` pre -DELETE /gemfire-api/v1/{region}/{key}{key1},{key2},...{keyN} -``` - -If any of the supplied keys are not found in the region, the request will fail and return a 404 NOT FOUND ERROR. - -## <a id="topic_fcn_g25_m4" class="no-quick-link"></a>Working with Queries - -Geode supports the use of queries to extract data from its regions. Using REST APIs, you can create and execute either prepared or ad-hoc queries on Geode regions. You can also update and delete prepared queries. - -## Listing Queries - -To find out which predefined and named queries are available in your deployment, use the following endpoint: - -``` pre -GET /gemfire-api/v1/queries -``` - -All queries that have been predefined and assigned IDs in Geode are listed. - -## <a id="topic_fcn_g25_m4__section_t4h_wtp_y4" class="no-quick-link"></a>Creating a New Query - -To create a query, use the following endpoint: - -``` pre -POST /gemfire-api/v1/queries?id=<queryId>&q=<OQL-statement> -``` - -Here are some examples: - -``` pre -http://localhost:7070/gemfire-api/v1/queries?id=selectOffers&q="SELECT DISTINCT c FROM /customers c, /orders o WHERE o.totalprice < $1 AND c.customerId = o.customerId" -``` - -**Note:** -The query must be provided as a URL parameter. You cannot specify OQL in the request body at this time. - -You can specify query bind parameters ($1) in your predefined queries and then pass in values at runtime. - -To update this query at a later time, use the [PUT operation](#topic_fcn_g25_m4__section_oj1_b5p_y4) described below. - -## <a id="topic_fcn_g25_m4__section_b1p_wtp_y4" class="no-quick-link"></a>Executing a Prepared Query - -To run a prepared query, use: - -``` pre -POST /gemfire-api/v1/queries/{queryId} -``` - -Specify the queryId in the URL. All query argument must be passed in the request body. For example: - -``` pre -http://localhost:7070/gemfire-api/v1/queries/selectOrders -``` - -``` pre -Request Payload: OQL bind parameter values HTTP message body of media type application/json -POST /gemfire-api/v1/queries/selectOrders -Accept: application/json -Content-Type: application/json - -[ - { - "@type": "int", - "@value": 2 - }, - { - "@type": "double", - "@value": 110.00 - } -] - -Response Payload: application/json - -200 OK -Content-Length: <#-of-bytes> -Content-Type: application/json - -[ - { - "description": "Purchase order for company - B", - "totalPrice": 350, - "purchaseOrderNo": 1112, - "customerId": 102, - "deliveryDate": "Thu Feb 20 00:00:00 IST 2014", - "contact": "John Doe", - "email": "j...@example.com", - "phone": "01-2048096", - "items": [ - { - "description": "Product-AAAA", - "quantity": 10, - "itemNo": 1, - "unitPrice": 20, - "totalPrice": 200, - "type-class": "org.apache.geode.web.rest.domain.Item" - }, - { - "description": "Product-BBB", - "quantity": 15, - "itemNo": 2, - "unitPrice": 10, - "totalPrice": 150, - "type-class": "org.apache.geode.web.rest.domain.Item" - } - ], - "orderDate": "Mon Feb 10 00:00:00 IST 2014", - "type-class": "org.apache.geode.web.rest.domain.Order" - }, - {...}, - {...} -} -``` - -Another example: - -``` pre -http://localhost:7070/gemfire-api/v1/queries/selectOrders -``` - -``` pre -Request Payload: OQL bind parameter values HTTP message body of media type application/json -POST /gemfire-api/v1/queries/selectCustomer -Accept: application/json -Content-Type: application/json -{ - "args": [ - { - "@type": "int", - "@value": 101 - } - ] -} - -Response-Payload: application/json - -200 Ok -Content-Length: 140 -Content-Type: application/json -[ - { - "firstName": "Jane", - "lastName": "Doe", - "customerId": 101, - "type-class": "org.apache.geode.web.rest.domain.Customer" - } -] -``` - -## <a id="topic_fcn_g25_m4__section_oj1_b5p_y4" class="no-quick-link"></a>Modifying a Prepared Query - -To modify an existing prepared query, use the following endpoint: - -``` pre -PUT /gemfire-api/v1/queries/{queryId} -``` - -Here are some examples: - -``` pre -http://localhost:7070/gemfire-api/v1/queries/selectOffers&q="SELECT DISTINCT c FROM /customers c, /orders o WHERE o.totalprice < $1 AND c.customerId = o.customerId" -``` - -You can specify query bind parameters ($1) in your predefined queries, and then pass in values at runtime. - -A PUT operation will only succeed if the specified queryId already exists (for example, created with the [POST operation](#topic_fcn_g25_m4__section_t4h_wtp_y4) above.) If the queryId does already exist, you will receive a 404 response - "Named query (selectKey456) does not exist!" - -## <a id="topic_fcn_g25_m4__section_igg_b5p_y4" class="no-quick-link"></a>Deleting a Prepared Query - -To delete an existing prepared query, use the following endpoint: - -``` pre -DELETE /gemfire-api/v1/queries/{queryId} -``` - -## <a id="topic_fcn_g25_m4__section_wbk_b5p_y4" class="no-quick-link"></a>Executing an Ad-Hoc Query - -To run an unnamed query, use the following endpoint: - -``` pre -GET /gemfire-api/v1/queries/adhoc?q=<OQL-statement> -``` - -Provide the OQL query string directly in the URL enclosed in single quotes. - -For example: - -``` pre -http://localhost:7070/gemfire-api/v1/queries/adhoc?q="SELECT * FROM /customers" -``` - -## <a id="topic_rbc_h25_m4" class="no-quick-link"></a>Working with Functions - -Geode REST APIs support the discovery and execution of predefined Geode functions on your cluster deployments. - -Before you can access functions using REST APIs, you must have already defined and registered the functions in your Geode deployment. Additionally, any domain objects that are being accessed by the functions must be available on the CLASSPATH of the server running the REST endpoint service. - -You can do the following with functions: - -- List all functions available in the Geode cluster. -- Execute a function, optionally specifying the region and members and/or member groups that are targeted by the function - -## Listing Functions - -To list all functions that are currently registered and deployed in the Geode cluster, use the following endpoint: - -``` pre -GET /gemfire-api/v1/functions -``` - -The list of returned functions includes the functionId, which you can use to execute the function as described in the next section. - -## Executing Functions - -To execute a function on a Geode cluster, use the following endpoint: - -``` pre -POST /gemfire-api/v1/functions/{functionId}?[&onRegion=regionname|&onMembers=member1,member2,...,memberN|&onGroups=group1,group2,...,groupN] -``` - -You have the option to target a specific region and members or member groups when executing your function. If you do not specify these parameters, the function will execute on all members that are hosting data in the entire cluster by default. Function arguments are passed in the request body. - -For example: - -``` pre -http://localhost:7070/gemfire-api/v1/functions/AddFreeItemToOrders -``` - -``` pre -Request Payload: application/json -POST /gemfire-api/v1/functions/AddFreeItemToOrders -Accept: application/json -Content-Type: application/json - -[ - { - "@type": "double", - "@value": 210 - }, - { - "@type": "org.apache.geode.web.rest.domain.Item", - "itemNo": "599", - "description": "Part X Free on Bumper Offer", - "quantity": "2", - "unitprice": "5", - "totalprice": "10.00" - } -] -``` - -In the above example, the `Item` domain object must be in the CLASSPATH of all members receiving the function. If the object is not defined, the function will fail with an `Internal Server` error. Look for `ClassNotFoundException`s in the stack trace. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_execute_adhoc_query.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_execute_adhoc_query.html.md.erb b/geode-docs/rest_apps/get_execute_adhoc_query.html.md.erb deleted file mode 100644 index 0a70c82..0000000 --- a/geode-docs/rest_apps/get_execute_adhoc_query.html.md.erb +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: GET /gemfire-api/v1/queries/adhoc?q=<OQL-statement> ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Run an unnamed (unidentified), ad-hoc query passed as a URL parameter. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries/adhoc?q=<OQL-statement> -``` - -## Parameters - -<table> -<colgroup> -<col width="33%" /> -<col width="33%" /> -<col width="33%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Parameter</th> -<th>Description</th> -<th>Example Values</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>q</td> -<td><strong>Required.</strong> OQL query statement. -<div class="note note"> -**Note:** -<p>Since the query string is passed in the URL, the OQL must be URL-encoded. Some HTTP clients such as Web browsers will automatically encode URLs; however, if you are not using one of those clients, you will need to URL encode the query string yourself.</p> -</div></td> -<td><code class="ph codeph">SELECT o FROM /orders o WHERE o.quantity > 2 AND o.totalprice > 110.00</code> -<p>(or URL encoded: <code class="ph codeph">SELECT%20o%20FROM%20%2Forders%20o%20WHERE%20o.quantity%20%3E%202%20AND%20o.totalprice%20%3E%20110.00</code>)</p> -<p><code class="ph codeph">SELECT * FROM /customers</code></p> -<p>(or URL encoded: <code class="ph codeph">SELECT%20*%20FROM%20/customers</code>)</p></td> -</tr> -</tbody> -</table> - -## Example Request - -``` pre -curl -i "http://localhost:8080/gemfire-api/v1/queries/adhoc?q=select%20*%20%20from%20/customers" -``` - -## Example Success Response - -``` pre -Response Payload: application/json - -200 OK -Content-Length: <#-of-bytes> -Content-Type: application/json -[ - { - "firstName": "John", - "lastName": "Doe", - "customerId": 101, - }, - { - "firstName": "Jane", - "lastName": "Doe", - "customerId": 102, - }, - { - .... - } -] -``` - -## Error Codes - -<table> -<colgroup> -<col width="50%" /> -<col width="50%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Status Code</th> -<th>Description</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>500 INTERNAL SERVER ERROR</td> -<td>Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. Some possible exceptions include: -<ul> -<li>Query is not permitted on this type of region!</li> -<li>Query execution time is exceeded max query execution time (gemfire.Cache.MAX_QUERY_EXECUTION_TIME) configured!</li> -<li>Data referenced in from clause is not available for querying!</li> -<li>Query execution gets canceled due to low memory conditions and the resource manager critical heap percentage has been set!</li> -<li>Server has encountered while executing Adhoc query!</li> -</ul></td> -</tr> -</tbody> -</table> - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_functions.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_functions.html.md.erb b/geode-docs/rest_apps/get_functions.html.md.erb deleted file mode 100644 index 9ae6867..0000000 --- a/geode-docs/rest_apps/get_functions.html.md.erb +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: GET /gemfire-api/v1/functions ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -List all registered Geode functions in the cluster. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/functions -``` - -## Parameters - -None. - -## Example Request - -``` pre -GET /gemfire-api/v1/functions -Accept: application/json -``` - -## Example Success Response - -``` pre -Response Payload: application/json - -200 OK -Content-Length: <#-of-bytes> -Content-Type: application/json -Location: https://localhost:8080/gemfire-api/v1/functions - -{ - "functions": [ - "AddFreeItemToOrders", - "GetRegions", - "GetDeliveredOrders" - ] -} -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| 404 NOT FOUND | Returned if no functions are found in the cluster. | -| 500 INTERNAL SERVER ERROR | Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. | - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_queries.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_queries.html.md.erb b/geode-docs/rest_apps/get_queries.html.md.erb deleted file mode 100644 index 71e0219..0000000 --- a/geode-docs/rest_apps/get_queries.html.md.erb +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: GET /gemfire-api/v1/queries ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -List all parameterized queries by ID or name. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries -``` - -## Parameters - -None - -## Example Request - -``` pre -Request Payload: null -GET /gemfire-api/v1/queries/ -Accept: application/json -``` - -## Example Response - -``` pre - -Response Payload: application/json - -200 OK -Content-Type: application/json -Location: http://localhost:8080/gemfire-api/v1/queries - -{ - "queries": [ - { - "id": "selectCustomer", - "oql": "SELECT c FROM /customers c WHERE c.customerId = $1" - }, - { - "id": "selectHighRollers", - "oql": "SELECT DISTINCT c FROM /customers c, /orders o WHERE o.totalprice > $1 AND c.customerId = o.customerId" - } - ] -} -``` - -## Error Codes - -| Â | Â | -|---------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| 500 INTERNAL SERVER ERROR | Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. | - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_region_data.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_region_data.html.md.erb b/geode-docs/rest_apps/get_region_data.html.md.erb deleted file mode 100644 index 7e7dd1a..0000000 --- a/geode-docs/rest_apps/get_region_data.html.md.erb +++ /dev/null @@ -1,132 +0,0 @@ ---- -title: GET /gemfire-api/v1/{region} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Read data for the region. The optional limit URL query parameter specifies the number of values from the Region that will be returned. The default limit is 50. If the user specifies a limit of âALLâ, then all entry values for the region will be returned. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}?[limit={<number>|ALL}] -``` - -## Parameters - -<table> -<colgroup> -<col width="33%" /> -<col width="33%" /> -<col width="33%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Parameter</th> -<th>Description</th> -<th>Example Values</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td><strong>limit</strong></td> -<td><strong>Optional.</strong> Specify a limit to the number of region entries to return. If the limit parameter is not specified, the default is to return 50 results. -<p>Default: 50</p></td> -<td>ALL -<p>80</p></td> -</tr> -</tbody> -</table> - -## Example Request - -``` pre -GET /gemfire-api/v1/orders/ -Accept: application/json -``` - -## Example Success Response - -``` pre -Response Payload: application/json - -200 OK -Server: Apache-Coyote/1.1 -Content-Location: http://localhost:8080/gemfire-api/v1/orders/3,1 -Content-Type: application/json -Transfer-Encoding: chunked -Date: Sat, 18 Jan 2014 21:03:08 GMT - -{ - "orders" : [ { - "purchaseOrderNo" : 1112, - "customerId" : 102, - "description" : "Purchase order for company - B", - "orderDate" : "02/10/2014", - "deliveryDate" : "02/20/2014", - "contact" : "John Doe", - "email" : "john....@example.com", - "phone" : "01-2048096", - "items" : [ { - "itemNo" : 1, - "description" : "Product-AAAA", - "quantity" : 10, - "unitPrice" : 20.0, - "totalPrice" : 200.0 - }, { - "itemNo" : 2, - "description" : "Product-BBB", - "quantity" : 15, - "unitPrice" : 10.0, - "totalPrice" : 150.0 - } ], - "totalPrice" : 350.0 - }, { - "purchaseOrderNo" : 111, - "customerId" : 101, - "description" : "Purchase order for company - A", - "orderDate" : "01/10/2014", - "deliveryDate" : "01/20/2014", - "contact" : "Jane Doe", - "email" : "jane....@example.com", - "phone" : "020-2048096", - "items" : [ { - "itemNo" : 1, - "description" : "Product-1", - "quantity" : 5, - "unitPrice" : 10.0, - "totalPrice" : 50.0 - }, { - "itemNo" : 1, - "description" : "Product-2", - "quantity" : 10, - "unitPrice" : 15.5, - "totalPrice" : 155.0 - } ], - "totalPrice" : 205.0 - } ] -} -``` - -## Error Codes - -| Status Code | Description | -|--------------------|----------------------------------------------------------------------------------------------------------------------------------| -| 400 BAD REQUEST | Limit parameter **X** is not valid! The specified limit value must ALL or an integer. | -| 404 NOT FOUND | Returned in region does not exist. | -| 500 INTERNAL ERROR | Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. | http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_region_data_for_multiple_keys.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_region_data_for_multiple_keys.html.md.erb b/geode-docs/rest_apps/get_region_data_for_multiple_keys.html.md.erb deleted file mode 100644 index 4252ac2..0000000 --- a/geode-docs/rest_apps/get_region_data_for_multiple_keys.html.md.erb +++ /dev/null @@ -1,238 +0,0 @@ ---- -title: GET /gemfire-api/v1/{region}/{key1},{key2},...,{keyN} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Read data for multiple keys in the region. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries[?ignoreMissingKey=true] -``` - -## Parameters - -<table> -<colgroup> -<col width="33%" /> -<col width="33%" /> -<col width="34%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Parameter</th> -<th>Description</th> -<th>Example Values</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>ignoreMissingKey</td> -<td><strong>Optional</strong>. Boolean to indicate whether to return non-existing keys as null responses. Use this to prevent 400 errors.</td> -<td>true -<p>false</p></td> -</tr> -</tbody> -</table> - -## Example Requests - -``` pre -GET /gemfire-api/v1/orders/1,2,13,4,5?ignoreMissingKey=true -Request Payload: null -Accept: application/json - - -GET /gemfire-api/v1/orders/1,3 -Request Payload: null -Accept: application/json -``` - -## Example Success Responses - -``` pre -Response Payload: application/json - -200 OK -Server: Apache-Coyote/1.1 -Content-Location: http://localhost:8080/gemfire-api/v1/orders/13,2,1,5,4 -Content-Type: application/json -Transfer-Encoding: chunked -Date: Sat, 18 Jan 2014 21:39:04 GMT - - -{ - "orders": [ - null, - { - "@type": "org.apache.geode.rest.internal.web.controllers.Order", - "purchaseOrderNo": 1112, - "customerId": 102, - "description": "Purchase order for company - B", - "orderDate": "02/10/2014", - "deliveryDate": "02/20/2014", - "contact": "John Doe", - "email": "john....@example.com", - "phone": "01-2048096", - "totalPrice": 350, - "items": [ - { - "itemNo": 1, - "description": "Product-AAAA", - "quantity": 10, - "unitPrice": 20, - "totalPrice": 200 - }, - { - "itemNo": 2, - "description": "Product-BBB", - "quantity": 15, - "unitPrice": 10, - "totalPrice": 150 - } - ] - }, - { - "@type": "org.apache.geode.rest.internal.web.controllers.Order", - "purchaseOrderNo": 11101, - "customerId": 101, - "description": "Purchase order for company - A", - "orderDate": "01/10/2014", - "deliveryDate": "01/20/2014", - "contact": "Jane Doe", - "email": "jane....@example.com", - "phone": "020-2048096", - "totalPrice": 205, - "items": [ - { - "itemNo": 1, - "description": "Product-1", - "quantity": 5, - "unitPrice": 10, - "totalPrice": 50 - }, - { - "itemNo": 3, - "description": "Product-3", - "quantity": 10, - "unitPrice": 100, - "totalPrice": 1000 - }, - { - "itemNo": 1, - "description": "Product-2", - "quantity": 10, - "unitPrice": 15.5, - "totalPrice": 155 - } - ] - }, - null, - null - ] -} - - -200 OK -Server: Apache-Coyote/1.1 -Content-Location: http://localhost:8080/gemfire-api/v1/orders/3,1 -Content-Type: application/json -Transfer-Encoding: chunked -Date: Sat, 18 Jan 2014 21:39:04 GMT - -{ - "orders" : [ { - "purchaseOrderNo" : 1112, - "customerId" : 102, - "description" : "Purchase order for company - B", - "orderDate" : "02/10/2014", - "deliveryDate" : "02/20/2014", - "contact" : "John Doe", - "email" : "john....@example.com", - "phone" : "01-2048096", - "items" : [ { - "itemNo" : 1, - "description" : "Product-AAAA", - "quantity" : 10, - "unitPrice" : 20.0, - "totalPrice" : 200.0 - }, { - "itemNo" : 2, - "description" : "Product-BBB", - "quantity" : 15, - "unitPrice" : 10.0, - "totalPrice" : 150.0 - } ], - "totalPrice" : 350.0 - }, { - "purchaseOrderNo" : 111, - "customerId" : 101, - "description" : "Purchase order for company - A", - "orderDate" : "01/10/2014", - "deliveryDate" : "01/20/2014", - "contact" : "Jane Doe", - "email" : "jane....@example.com", - "phone" : "020-2048096", - "items" : [ { - "itemNo" : 1, - "description" : "Product-1", - "quantity" : 5, - "unitPrice" : 10.0, - "totalPrice" : 50.0 - }, { - "itemNo" : 1, - "description" : "Product-2", - "quantity" : 10, - "unitPrice" : 15.5, - "totalPrice" : 155.0 - } ], - "totalPrice" : 205.0 - } ] -} -``` - -## Error Codes - -| Status Code | Description | -|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| 400 BAD REQUEST | Returned if one or more of the supplied keys is not found in the region and ignoreMissingKey=false (default if parameter is not specified); returned if the specified value for the ignoreMissingKey parameter is a value other than 'true' or 'false'. | -| 404 NOT FOUND | If the specified region does not exist. | - -## Example Error Response - -``` pre -GET /gemfire-api/v1/orders/1,2,13,4,5 -Request Payload: null -Accept: application/json -Response Payload: application/json - -400 BAD_REQUEST -Server: Apache-Coyote/1.1 -Content-Type: application/json -Content-Length: 51 -Date: Wed, 21 May 2014 11:24:00 GMT -Connection: close - -"Requested keys [13,4,5] not exist in region [orders]" -``` - -## Implementation Notes - -The response body sets the region name as key to the array of values. For example "orders" : <VALUE\_ARRAY>. http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_region_key_data.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_region_key_data.html.md.erb b/geode-docs/rest_apps/get_region_key_data.html.md.erb deleted file mode 100644 index 8549ee0..0000000 --- a/geode-docs/rest_apps/get_region_key_data.html.md.erb +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: GET /gemfire-api/v1/{region}/{key} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Read data for a specific key in the region. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}/{key} -``` - -## Parameters - -None. - -## Example Request - -``` pre -GET /gemfire-api/v1/orders/1 - -Request Payload: null -Accept: application/json -``` - -## Example Responses - -``` pre -Response Payload: application/json - -200 OK -Server: Apache-Coyote/1.1 -Content-Location: http: //localhost:8080/gemfire-api/v1/orders/1 -Content-Type: application/json -Transfer-Encoding: chunked -Date: Sat, 18 Jan 2014 21:27:59 GMT - -{ - "purchaseOrderNo" : 111, - "customerId" : 101, - "description" : "Purchase order for company - A", - "orderDate" : "01/10/2014", - "deliveryDate" : "01/20/2014", - "contact" : "Jane Doe", - "email" : "jane....@example.com", - "phone" : "020-2048096", - "items" : [ { - "itemNo" : 1, - "description" : "Product-1", - "quantity" : 5, - "unitPrice" : 10.0, - "totalPrice" : 50.0 - }, { - "itemNo" : 1, - "description" : "Product-2", - "quantity" : 10, - "unitPrice" : 15.5, - "totalPrice" : 155.0 - } ], - "totalPrice" : 205.0 -} -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| 400 BAD REQUEST | Returned if the supplied key is not found in the region. | -| 404 NOT FOUND | Returned if key does not exist for the region. | -| 500 INTERNAL SERVER ERROR | Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. | http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_region_keys.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_region_keys.html.md.erb b/geode-docs/rest_apps/get_region_keys.html.md.erb deleted file mode 100644 index fa7bbd0..0000000 --- a/geode-docs/rest_apps/get_region_keys.html.md.erb +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: GET /gemfire-api/v1/{region}/keys ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -List all keys for the specified region. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}/{keys} -``` - -## Parameters - -None. - -## Example Request - -``` pre -GET /gemfire-api/v1/orders/keys -``` - -## Example Success Response - -``` pre -Response Payload: application/json - -200 OK -Server: Apache-Coyote/1.1 -Location: http://localhost:8080/gemfire-api/v1/orders/keys -Content-Type: application/json -Transfer-Encoding: chunked -Date: Sat, 18 Jan 2014 21:20:05 GMT -{ "keys": [ - "1", - "2", - "3" - ] -} -``` - -## Error Codes - -| Status Codes | Description | -|---------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| 404 NOT FOUND | Specified region does not exist. | -| 405 METHOD NOT ALLOWED | Returned if any HTTP request method other than GET (for example, POST, PUT, DELETE, etc.) is used. | -| 500 INTERNAL SERVER ERROR | Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. | - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_regions.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_regions.html.md.erb b/geode-docs/rest_apps/get_regions.html.md.erb deleted file mode 100644 index b8e6add..0000000 --- a/geode-docs/rest_apps/get_regions.html.md.erb +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: GET /gemfire-api/v1 ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -List all available resources (regions) in the Geode cluster. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1 -``` - -## Parameters - -None. - -## Example Request - -``` pre -GET /gemfire/v1/ -Accept: application/json -``` - -## Example Success Response - -``` pre -Response Payload: application/json - -200 OK -Server: Apache-Coyote/1.1 -Location: http://localhost:8080/gemfire-api/v1 -Content-Type: application/json -Transfer-Encoding: chunked -Date: Sat, 18 Jan 2014 20:05:47 GMT - { - "regions": [ - { - "name": "customers", - "type": "REPLICATE", - "key-constraint": "java.lang.String", - "value-constraint": "org.apache.geode.pdx.PdxInstance" - }, - { - "name": "items", - "type": "REPLICATE", - "key-constraint": null, - "value-constraint": null - }, - { - "name": "orders", - "type": "PARTITION", - "key-constraint": null, - "value-constraint": null - }, - { - "name": "primitiveKVStore", - "type": "PARTITION", - "key-constraint": null, - "value-constraint": null - }, - { - "name": "empty_region", - "type": "EMPTY", - "key-constraint": "java.lang.String", - "value-constraint": "org.apache.geode.pdx.PdxInstance" - } - ] -} -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|-------------------------------------------------| -| 404 NOT FOUND | No regions were found at the provided endpoint. | -| 500 INTERNAL SERVER ERROR | Encountered error at server. | - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/get_servers.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/get_servers.html.md.erb b/geode-docs/rest_apps/get_servers.html.md.erb deleted file mode 100644 index 1ac585f..0000000 --- a/geode-docs/rest_apps/get_servers.html.md.erb +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: GET /gemfire-api/v1/servers ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Mechanism to obtain a list of all members in the distributed system that are running the REST API service. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/servers -``` - -## Parameters - -None. - -## Example Request - -``` pre -Request Payload: null -Request: GET /gemfire-api/v1/servers -Response Payload: application/json -``` - -## Example Success Response - -``` pre -200 OK - -Content-Length: <#-of-bytes> -Content-Type: application/json; charset=utf-8 - -[ - "http://<HOST_NAME1>:<PORT1>", - "http://<HOST_NAME2>:<PORT2>", - "http://<HOST_NAME3>:<PORT3>", - "http://<HOST_NAME4>:<PORT4>" -] -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|---------------------------------------------------------------------------------------------| -| 500 INTERNAL SERVER ERROR | Returned if Geode throws an error while executing the request. | - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/head_region_size.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/head_region_size.html.md.erb b/geode-docs/rest_apps/head_region_size.html.md.erb deleted file mode 100644 index 3a83bb6..0000000 --- a/geode-docs/rest_apps/head_region_size.html.md.erb +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: HEAD /gemfire-api/v1/{region} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -An HTTP HEAD request that returns region's size (number of entries) within the HEADERS, which is a response without the content-body. Region size is specified in the pre-defined header named "Resource-Count". - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region} -``` - -## Parameters - -None. - -## Example Request - -``` pre -Request Payload: null -HEAD /gemfire-api/v1/customers -Response Payload: null -``` - -## Example Success Response - -``` pre -200 OK - -Content-Length: <#-of-bytes> -Content-Type: application/json; charset=utf-8 -... - -Resource-Count: 8192 -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|---------------------------------------------------------------------------------------------| -| 400 Bad Request | Returned if Geode throws an error while executing the request. | -| 404 Resource Not Found | Region does not exist. | -| 500 Internal Server Error | Geode has thown an error or exception. | - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/ping_service.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/ping_service.html.md.erb b/geode-docs/rest_apps/ping_service.html.md.erb deleted file mode 100644 index d6339e3..0000000 --- a/geode-docs/rest_apps/ping_service.html.md.erb +++ /dev/null @@ -1,54 +0,0 @@ ---- -title: \[HEAD | GET\] /gemfire-api/v1/ping ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Mechanism to check for REST API server and service availability. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/ping -``` - -## Parameters - -None. - -## Example Request - -``` pre -HEAD /gemfire/v1/ping -GET /gemfire/v1/ping -``` - -## Example Success Response - -``` pre -200 OK -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|--------------------------------------------------------------------------------------------| -| 404 NOT FOUND | The Developer REST API service is not available. | -| 500 INTERNAL SERVER ERROR | Encountered error at server. Check the Geode exception trace. | - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/post_create_query.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/post_create_query.html.md.erb b/geode-docs/rest_apps/post_create_query.html.md.erb deleted file mode 100644 index 9062948..0000000 --- a/geode-docs/rest_apps/post_create_query.html.md.erb +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: POST /gemfire-api/v1/queries?id=<queryId>&q=<OQL-statement> ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Create (prepare) the specified parameterized query and assign the corresponding ID for lookup. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries?id=<queryId>&q="<OQL-statement>" -``` - -## Parameters - -<table> -<colgroup> -<col width="33%" /> -<col width="33%" /> -<col width="33%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Parameter</th> -<th>Description</th> -<th>Example Values</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>id</td> -<td><strong>Required.</strong> Unique identifier for the named parameterized query.</td> -<td>selectCustomers</td> -</tr> -<tr class="even"> -<td>q</td> -<td><strong>Required.</strong> OQL query statement. Use doublequotes to surround the OQL query statement.</td> -<td><pre class="pre"><code>"SELECT o FROM /orders o WHERE o.quantity > $1 AND o.totalprice > $2"</code></pre></td> -</tr> -</tbody> -</table> - -**Note:** -For this release, you cannot specify the query string inside the request body (as JSON). You must specify the query as a URL parameter. - -## Example Request - -``` pre -POST /gemfire-api/v1/queries?id=selectOrders&q="SELECT o FROM /orders o WHERE o.quantity > $1 AND o.totalprice > $2" -Accept: application/json -``` - -## Example Success Response - -``` pre -Response Payload: null - -201 CREATED -Location: http://localhost:8080/gemfire-api/v1/queries/selectOrders -``` - -## Error Codes - -<table> -<colgroup> -<col width="50%" /> -<col width="50%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Status Code</th> -<th>Description</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>400 BAD REQUEST</td> -<td>Returned if user does not specify a query ID or a malformed OQL statement.</td> -</tr> -<tr class="even"> -<td>500 INTERNAL SERVER ERROR</td> -<td>Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. -<ul> -<li>Query store does not exist!</li> -</ul></td> -</tr> -</tbody> -</table> - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/post_execute_functions.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/post_execute_functions.html.md.erb b/geode-docs/rest_apps/post_execute_functions.html.md.erb deleted file mode 100644 index 32d8cd7..0000000 --- a/geode-docs/rest_apps/post_execute_functions.html.md.erb +++ /dev/null @@ -1,142 +0,0 @@ ---- -title: POST /gemfire-api/v1/functions/{functionId} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Execute Geode function on entire cluster or on a specified region, members and member groups. - -## Resource URL - -``` pre -/gemfire-api/v1/functions/{functionId}?[&onRegion=regionname|&onMembers=member1,member2,...,memberN|&onGroups=group1,group2,...,groupN] -``` - -## Parameters - -- **{functionId}** This required parameter is the name of the function to execute. Place it in the Resource URL, as in the example request: `AddFreeItemToOrders`. -- **onRegion** This optional parameter specifies the target region for the function. You can only invoke a function on a single region. Substitute the region's name for `regionname` within the sample syntax `onRegion=regionname`. -- **onMembers** This optional parameter specifies the target members of the function. For multiple members, specify a comma-delimited list of member names, as in the sample `onMembers=member1,member2`. -- **onGroups** This optional parameter specifies the target groups of the function. For multiple groups, specify a comma-delimited list of group names, as in the sample `onGroups=membergroup1,membergroup2`. -- **filter** This optional parameter can only be used with the **onRegion** parameter, where the region has a `data-policy` of `PARTITION`. The parameter specifies a list of applicable keys that the function needs to filter on. There are 3 keys in the example Resource URL: - - ``` pre - http://serverURL/functions/SampleFunction?onRegion=TestPartitionRegion&filter=key1,key2,key3 - ``` - -- Any *function arguments* are passed in the request body in JSON format. The content of the arguments can depend on how the function is defined. Use @type to declare argument types and @value for specifying a scalar value. An example set of arguments: - - ``` pre - [ - { - "@type": "double", - "@value": 210 - }, - { - "@type": "org.apache.geode.web.rest.domain.Item", - "itemNo": "599", - "description": "Part X Free on Bumper Offer", - "quantity": "2", - "unitprice": "5", - "totalprice": "10.00" - } - ] - ``` - -## Example Requests - -``` pre -Request Payload: application/json -POST /gemfire-api/v1/functions/AddFreeItemToOrders -Accept: application/json -Content-Type: application/json - -[ - { - "@type": "double", - "@value": 210 - }, - { - "@type": "org.apache.geode.web.rest.domain.Item", - "itemNo": "599", - "description": "Part X Free on Bumper Offer", - "quantity": "2", - "unitprice": "5", - "totalprice": "10.00" - } -] -``` - -Another example: - -``` pre -Request Payload: null - -POST /gemfire-api/v1/functions/getDeliveredOrders -Accept: application/json -``` - -## Example Success Responses - -``` pre -Response Payload: null -200 OK -Location:http: //localhost:8080/gemfire-api/v1/functions/AddFreeItemToOrders -``` - -Another example response: - -``` pre -Response Payload: application/json - -200 OK -Content-Length: 316 -Content-Type: application/json -Location: http://localhost:8080/gemfire-api/v1/functions/getDeliveredOrders -[ - { - "purchaseOrderNo": "1121", - "deliveryDate": "Thu Feb 20 00:00:00 IST 2014" - }, - { - "purchaseOrderNo": "777", - "deliveryDate": "Thu Feb 20 00:00:00 IST 2014" - }, - { - ... - } -] -``` - -## Error Codes - -Status code 500 INTERNAL SERVER ERROR is an error encountered in a server. Check the HTTP response body for a stack trace of the exception. Causes: - -- The Region identified by name (%1$s) could not found! -- Could not found the specified members in disributed system! -- no member(s) are found belonging to the provided group(s)! -- Disributed system does not contain any valid data node to run the specified function! -- Key is of an inappropriate type for this region! -- Specified key is null and this region does not permit null keys! -- Server has encountered low memory condition! -- Input parameter is null! -- Could not convert function results into Restful (JSON) format! -- Function has returned results that could not be converted into Restful (JSON) format! -- Server has encountered an error while processing function execution! - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/post_execute_query.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/post_execute_query.html.md.erb b/geode-docs/rest_apps/post_execute_query.html.md.erb deleted file mode 100644 index 7d0853c..0000000 --- a/geode-docs/rest_apps/post_execute_query.html.md.erb +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: POST /gemfire-api/v1/queries/{queryId} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Execute the specified named query passing in scalar values for query parameters in the POST body. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/queries/{queryId} -``` - -## Parameters - -<table> -<colgroup> -<col width="33%" /> -<col width="33%" /> -<col width="33%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Parameter</th> -<th>Description</th> -<th>Example Values</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>{queryId}</td> -<td>QueryID for named query.</td> -<td>selectOrders</td> -</tr> -<tr class="even"> -<td><em>query bind parameter values</em></td> -<td>Bind parameters for the query are specified in the request body (JSON).</td> -<td><p>Specify the parameter @type and @value for each bind parameter. For example, to provide values to the following query:</p> -<pre class="pre codeblock"><code>SELECT o FROM /orders o WHERE o.quantity > $1 AND o.totalprice > $2</code></pre> -<p>You could pass in the following JSON in the request body as the bind parameters:</p> -<pre class="pre codeblock"><code>[ - { - "@type": "int ", - "@value": 2 - }, - { - "@type": "double ", - "@value": 110.00 - } -]</code></pre></td> -</tr> -</tbody> -</table> - -## Example Request - -``` pre -POST /gemfire-api/v1/queries/selectOrders -Accept: application/json -Content-Type: application/json - -[ - { - "@type": "int ", - "@value": 2 - }, - { - "@type": "double ", - "@value": 110.00 - } -] -``` - -## Example Success Response - -``` pre -Response Payload: application/json - -200 OK -Content-Length: <#-of-bytes> -Content-Type: application/json - -[ - { - "description": "Purchase order for company - B", - "totalPrice": 350, - "purchaseOrderNo": 1112, - "customerId": 102, - "deliveryDate": "Thu Feb 20 00:00:00 IST 2014", - "contact": "John Doe", - "email": "john....@pivotal.io", - "phone": "01-2048096", - "items": [ - { - "description": "Product-AAAA", - "quantity": 10, - "itemNo": 1, - "unitPrice": 20, - "totalPrice": 200, - "type-class": "org.apache.geode.web.rest.domain.Item" - }, - { - "description": "Product-BBB", - "quantity": 15, - "itemNo": 2, - "unitPrice": 10, - "totalPrice": 150, - "type-class": "org.apache.geode.web.rest.domain.Item" - } - ], - "orderDate": "Mon Feb 10 00:00:00 IST 2014", - "type-class": "org.apache.geode.web.rest.domain.Order" - }, - {...}, - {...} -} -``` - -## Error Codes - -<table> -<colgroup> -<col width="50%" /> -<col width="50%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Status Code</th> -<th>Description</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>404 NOT FOUND</td> -<td>Query with specified ID could not be found.</td> -</tr> -<tr class="even"> -<td>500 INTERNAL SERVER ERROR</td> -<td>Encountered error at server: -<ul> -<li>Syntax of the OQL queryString is invalid!</li> -<li>A function was applied to a parameter that is improper for that function!</li> -<li>Bind parameter is not of the expected type!</li> -<li>Name in the query cannot be resolved!"</li> -<li>The number of bound parameters does not match the number of placeholders!</li> -<li>Query is not permitted on this type of region!</li> -<li>Query execution time is exceeded max query execution time (gemfire.Cache.MAX_QUERY_EXECUTION_TIME) configured!</li> -<li>Data referenced in from clause is not available for querying!"</li> -<li>Query execution gets canceled due to low memory conditions and the resource manager critical heap percentage has been set!"</li> -<li>Error encountered while executing named query!"</li> -</ul></td> -</tr> -</tbody> -</table> - - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/post_if_absent_data.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/post_if_absent_data.html.md.erb b/geode-docs/rest_apps/post_if_absent_data.html.md.erb deleted file mode 100644 index 89925e3..0000000 --- a/geode-docs/rest_apps/post_if_absent_data.html.md.erb +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: POST /gemfire-api/v1/{region}?key=<key> ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Create (put-if-absent) data in region. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}?key=<key> -``` - -## Parameters - -<table> -<colgroup> -<col width="33%" /> -<col width="33%" /> -<col width="34%" /> -</colgroup> -<thead> -<tr class="header"> -<th>Parameter</th> -<th>Description</th> -<th>Example Values</th> -</tr> -</thead> -<tbody> -<tr class="odd"> -<td>key</td> -<td><strong>Optional.</strong> If you do not specify a key in the URL, a key will automatically be generated for you.</td> -<td>123 -<p>myOrder</p></td> -</tr> -</tbody> -</table> - -## Example Request - -``` pre -Request Payload: application/json -POST /gemfire-api/v1/orders?key=2 - -Accept: application/json -Content-Type: application/json -{ - "@type": "org.apache.geode.web.rest.domain.Order", - "purchaseOrderNo": 112, - "customerId": 1012, - "description": "Purchase Order for myCompany", - "orderDate": "02/10/2014", - "deliveryDate": "02/20/2014", - "contact": "John Doe", - "email": "john....@example.com", - "phone": "01-2048096", - "totalPrice": 225, - "items": [ - { - "itemNo": 1, - "description": "Product2, PartA", - "quantity": 10, - "unitPrice": 5, - "totalPrice": 50 - }, - { - "itemNo": 2, - "description": "Product2, PartB", - "quantity": 20, - "unitPrice": 20, - "totalPrice": 400 - } - ] -} -``` - -## Example Success Response - -``` pre -Response Payload: null -201 CREATED -Location: http://localhost:8080/gemfire-api/v1/orders/2 -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| 400 BAD REQUEST | Returned if JSON content is malformed. | -| 404 NOT FOUND | Returned if the specified region does not exist. | -| 409 CONFLICT | Returned if the provided key already exists in the region. | -| 500 INTERNAL SERVER ERROR | Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. | - -## Example Error Response - -``` pre -409 Conflict -Location:http://localhost:8080/gemfire-api/v1/orders/2 -Content-Type: application/json - -{ - "purchaseOrderNo": 112, - "customerId": 1012, - "description": "Purchase Order for myCompany", - "orderDate": "02/10/2014", - "deliveryDate": "02/20/2014", - "contact": "John Doe", - "email": "john....@example.com", - "phone": "01-2048096", - "totalPrice": 225, - "items": [ - { - "itemNo": 1, - "description": "Product2, PartA", - "quantity": 10, - "unitPrice": 5, - "totalPrice": 50 - }, - { - "itemNo": 2, - "description": "Product2, PartB", - "quantity": 20, - "unitPrice": 20, - "totalPrice": 400 - } - ] -} -``` http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/84cfbdfc/geode-docs/rest_apps/put_multiple_values_for_keys.html.md.erb ---------------------------------------------------------------------- diff --git a/geode-docs/rest_apps/put_multiple_values_for_keys.html.md.erb b/geode-docs/rest_apps/put_multiple_values_for_keys.html.md.erb deleted file mode 100644 index fa17580..0000000 --- a/geode-docs/rest_apps/put_multiple_values_for_keys.html.md.erb +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: PUT /gemfire-api/v1/{region}/{key1},{key2},...{keyN} ---- - -<!-- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. ---> - -Update or insert (put) data for multiple keys in the region. - -## Resource URL - -``` pre -http://<hostname_or_http-service-bind-address>:<http-service-port>/gemfire-api/v1/{region}/{key},{key2},...{keyN} -``` - -## Parameters - -See [PUT /gemfire-api/v1/{region}/{key}?op=REPLACE](put_replace_data.html#topic_itv_mg5_m4) and [PUT /gemfire-api/v1/{region}/{key}?op=CAS](put_update_cas_data.html#topic_itv_mg5_m4). - -## Example Request - -``` pre -Request Payload: application/json - -PUT /gemfire-api/v1/orders/4,5 - -Accept: application/json -Content-Type: application/json -[ - { - "@type": "org.apache.geode.web.rest.domain.Order", - "purchaseOrderNo": 555, - "customerId": 5, - "description": "Order for 23 Corp", - "orderDate": "01/15/2014", - "deliveryDate": "02/20/2014", - "contact": "Jane Doe", - "email": "jane....@example.com", - "phone": "01-2048096", - "items": [ - { - "itemNo": 321, - "description": "part 21", - "quantity": 2, - "unitPrice": 49.95, - "totalPrice": 99.9 - } - ], - "totalPrice": 99.9 - }, - { - "@type": "org.apache.geode.web.rest.domain.Order", - "purchaseOrderNo": 777, - "customerId": 11, - "description": "Order for MNP Corp", - "orderDate": "02/10/2014", - "deliveryDate": "02/20/2014", - "contact": "Trent Jones", - "email": "trent.jo...@example.com", - "phone": "503-555-1221", - "items": [ - { - "itemNo": 321, - "description": "Product-21", - "quantity": 3, - "unitPrice": 49.95, - "totalPrice": 149.85 - } - ], - "totalPrice": 149.85 - } -] -``` - -## Example Success Response - -``` pre -Response-payload: null - -200 OK -``` - -## Error Codes - -| Status Code | Description | -|---------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| 400 BAD REQUEST | Returned if one or more of the supplied keys is an invalid format. | -| 404 NOT FOUND | Returned if the region is not found. | -| 500 INTERNAL SERVER ERROR | Error encountered at Geode server. Check the HTTP response body for a stack trace of the exception. |