vania-janet/multiturn-rag-retrieval-data huggingface dataset:
" pm.response.to.be.success; ",
"});",
"",
"pm.test("Response contains expected content", function() {",
" pm.expect(pm.response.text()).to.include("ListBucketResult");",
"});"
]
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer":
{
"key": "token",
"value": "{{iamtoken}}",
"type": "string"
}
]
},
"method": "GET",
"header": ],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{endpoint-region}}cloud-object-storage.appdomain.cloud/{{bucket}}?prefix=new",
"protocol": "https",
"host":
"{{endpoint-region}}",
"objectstorage",
"softlayer",
"net"
],
"path":
"{{bucket}}"
],
"query":
{
"key": "prefix",
"value": "new"
}
]
},
"description": "Retrieve the list of files available in the bucket"
},
"response": ]
},
{
"name": "Retrieve text file",
"event":
{
"listen": "test",
"script": {
"id": "58817cc7-7d15-45a9-b372-7712d2fd389d",
"type": "text/javascript",
Property property = appConfigClient.getProperty("json-property");
if (property != null) {
property.getPropertyDataType(); // STRING
property.getPropertyDataFormat(); // JSON
property.getCurrentValue(entityId, entityAttributes); // JSONObject or JSONArray is returned
}

// Example Below
// input json :- [{"role": "developer", "description": "do coding"},{"role": "tester", "description": "do testing"}]
// expected output :- "do coding"

JSONArray tar_val = (JSONArray) property.get_current_value(entityId, entityAttributes);
String expected_output = (String) ((JSONObject) tar_val.get(0)).get('description');

// input json :- {"role": "tester", "description": "do testing"}
// expected output :- "tester"

JSONObject tar_val = (JSONObject) property.get_current_value(entityId, entityAttributes);
String expected_output = (String) tar_val.get('role');

Property property = appConfigClient.getProperty("yaml-property");
if (property != null) {
property.getPropertyDataType(); // STRING
property.getPropertyDataFormat(); // YAML
property.getCurrentValue(entityId, entityAttributes); // Yaml String is returned
}
Show more





 Set listener for feature or property changes 

The SDK provides mechanism to notify you in real time when feature flag's or property's configuration changes. You can subscribe to configuration changes by using the same appConfigClient.
409 [Conflict](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.8) This code SHOULD be returned when the request cannot be processed because of a conflict between the request and the current client-controlled state in the system. See [Conflicts](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-status-codesconflicts). 
 410 [Gone](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.9) This code MAY be returned to indicate that a resource is no longer available and is not expected to return to availability. However, if it is impractical for a system to maintain a record of deleted or purged resources, or poses a security risk, 404 MAY be returned instead. 
 412 [Precondition Failed](https://datatracker.ietf.org/doc/html/rfc7232section-4.2) This code MUST be returned when the client specified one or more preconditions in its headers, and the server cannot meet those preconditions. 
 413 [Payload Too Large](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.11) This code MUST be returned when a request payload size exceeds [the documented limit](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-formatrequest-body-constraints). 
 414 [URI Too Long](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.12) This code MUST be returned when a request's URI length exceeds the [the documented limit](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-urisconstraints)
-H "Accept: application/json"
-H "servicekey: <SERVICE_KEY>"

Where <PRESET_ID> is the presetid value returned when [running the GET method to return all presets.](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-preset-apipreset-api-get-all)

A response similar to the following will be returned:

{"channels":[{"integration":"email","immediate":false,"terminal":true,"triggerlimit":1,"triggerinterval":"30","operator":"presence","emails":"MyUser@mycompany.com"],"alertid":"4991f78d6d"}],"presetid":"291a4100b0","account":"090bba4d47","name":"Email preset","_created":"2021-11-18T15:15:53.414Z","_modified":"2021-11-18T15:15:53.414Z"}





 Modifying a preset 

The following modifies a view by adding an alert.

curl --request PUT https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/<PRESET_ID> 
-H "Accept: application/json" 
-H "Content-Type: application/json" 
-H "servicekey: <SERVICE_KEY>" 
-d '{ "name": "My preset", "channels": ["<CHANNEL>"] }'

Where <PRESET_ID> is the presetid value returned when [running the GET method to return all presets.](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-preset-apipreset-api-get-all)

A response similar to the following is returned:
301 [Moved Permanently](https://datatracker.ietf.org/doc/html/rfc7231section-6.4.2) This code SHOULD be returned when a resource's URI changes, in order to keep the previous URI from failing. When this code is returned, the server MUST also include a Location header. It indicates that the current request, and all future requests, should be directed to the URI provided in the Location header. 
 302 [Found](https://datatracker.ietf.org/doc/html/rfc7231section-6.4.3) This code SHOULD NOT be used. Instead, temporary redirects should respond with 303 or 307, as applicable, to avoid ambiguity.<br><br>[4]<br><br> It MAY only be used if there is strong evidence that clients of a service will not be able to parse or understand status codes 303 and 307. 
 303 [See Other](https://datatracker.ietf.org/doc/html/rfc7231section-6.4.4) This code MAY be returned to indicate the request was processed and more information can be obtained with a GET request to the URI provided in the Location header, which MUST be included when this code is returned. This is most useful in such cases where a resource at another location is relevant to a request made with a POST, PUT, or DELETE request. 
 304 [Not Modified](https://datatracker.ietf.org/doc/html/rfc7232section-4.1) This code MAY be returned to indicate that the previously-downloaded resource a client possesses is up-to-date, and there's no need to resend. This code MUST NOT be returned except in response to conditional requests. Responses with a 304 status MUST NOT have a response body. 
 307 [Temporary Redirect](https://datatracker.ietf.org/doc/html/rfc7231section-6.4.7) This code MAY be returned to indicate that the request should be resubmitted to the URI provided in the Location header, which MUST be included when this code is returned, and that future requests should use the original URI.
Default for newly constructed Requests (in other words, new Request (url) ) is follow. Valid options:



* follow: If a redirect response is returned to the fetch, another fetch is fired based on the Location header in the response until a non-redirect code is returned. For example, await fetch(..) could never return a 301 redirect.
* manual: redirect responses return from a fetch.













 Properties 

All properties of an incoming Request object (event.request) are read-only. To modify a request, you must create a Request object and pass the options to modify to its constructor.



* body: A simple getter that exposes a ReadableStream of the contents.
* bodyUsed: A Boolean that declares if the body was used in a response.
* cf: An object that contains data provided by our partners at Cloudflare.
* headers: Contain the associated Headers object for the request.
* method: The request method, such as GET or POST, associated with the request.
* redirect: The redirect mode to use ( follow or manual).
* url: Contains the URL of the request.







 The cf object 

In addition to the properties on the standard Request object, you can use a request.cf object to control how features are applied as well as other custom information provided by Cloudflare. For example,

if (request.cf.asn == 64512) {
return new Response('Block the ASN 64512 response')
}

If you are using [https://cloudflareworkers.com](https://cloudflareworkers.com) to write and test your scripts, the request.cf content is not available in preview mode. You must be in production to run that content.

These properties contain special information from an incoming request to help with your app's logic. All plans have access to:



* asn: ASN of the incoming request (for example, 395747).
* colo: The three-letter airport code of the data center that the request hit (for example, "DFW").
Testing 



  Unit testing 

The SDK MUST have unit tests for each service which include both positive and negative tests of each operation. The negative tests should exercise some of the most common error conditions (missing parameter or property, invalid JSON response body, etc.). In this context, the term "unit tests" refers to the fact that the tests can use mocking to simulate the service endpoint's behavior, rather than interacting with an actual service endpoint.

The goal of the unit tests is to provide broad coverage of the generated SDK code to verify that it works correctly in isolation.

If you use the IBM SDK generator to build your SDK, it will produce suitable unit test code for the main SDK languages (Go, Java, Node.js, and Python).





  Integration testing 

The SDK MUST have integration tests for each service which use an actual instance of the service endpoint to verify that the generated SDK code works properly with the service endpoint implementation. This, in turn, verifies the correctness of the service's API definition.

The integration tests MUST contain, at a minimum, a positive test involving each operation of the service. Additionally, the integration tests SHOULD include tests of common error conditions, ideally including tests involving each error status code that is defined in the service's API definition.



  Guidelines for integration tests 

Integration tests MUST:



*  Use an actual instance of the service endpoint
*  Include positive tests of each operation
*  Use realistic values for operation parameters and model properties



Integration tests SHOULD:



*  Include negative tests of common error conditions
*  Include tests involving each error response status code defined in the service's API definition
*  Excercise pagination for each "list"-type operation that supports pagination
Yes String or JSON array Yes 
 limit Limit the number of returned documents to the specified count. Yes Numeric Yes 
 reduce Use the reduce function. Yes Boolean True Yes 
 skip Skip this number of rows from the start. Yes Numeric 0 Yes 
 stable Specify whether to use the same replica of the index on each request. The default value false contacts all replicas and returns the result from the first, fastest responder. Setting it to true, when used with update=false, might improve consistency at the expense of increased latency and decreased throughput if the selected replica is not the fastest of the available replicas.<br><br>Note: In general, setting this parameter to true is discouraged and not recommended when you use update=true. Yes Boolean False No 
 stale Note: stale is deprecated. Use stable and update instead.<br><br>Specify whether to use the results from a stale view without triggering a rebuild of all views within the encompassing design doc.<br><br><br><br> * ok is equivalent to stable=true&update=false.<br> * update_after is equivalent to stable=true&update=lazy.<br><br><br> Yes String False No 
 start_key Return records, starting with the specified key. Yes String or JSON array Yes 
 start_key_docid Return records, starting with the specified document ID. Yes String Yes 
 update Specify whether or not the view in question must be updated before you respond to the user.<br><br><br><br> * true - Return results after the view is updated.<br> * false - Return results without updating the view.<br> * lazy - Return the view results without waiting for an update, but update them immediately after the request.<br><br><br> Yes String True Yes 



Using include_docs=true might have [performance implications](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-using-viewsmulti-document-fetching).
).get_result()

print(json.dumps(res_create_resource_group, indent=2))

createResourceGroupOptions := resourceManagerService.NewCreateResourceGroupOptions()
createResourceGroupOptions.SetAccountID(exampleUserAccountID)
createResourceGroupOptions.SetName("ExampleGroup")

resCreateResourceGroup, response, err := resourceManagerService.CreateResourceGroup(createResourceGroupOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(resCreateResourceGroup, "", " ")
fmt.Println(string(b))

const params = {
accountId: exampleUserAccountId,
name: "ExampleGroup"
};

resourceManagerService.createResourceGroup(params)
.then(res => {
resourceGroupId = res.result.id;
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});





 Before you begin 

Before you can manage resource groups by using Terraform, make sure that you have completed the following:



* Install the Terraform CLI and configure the IBM Cloud Provider plug-in for Terraform. For more information, see the tutorial for [Getting started with Terraform on IBM Cloud®](https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-getting-started). The plug-in abstracts the IBM Cloud APIs that are used to complete this task.
* Create a Terraform configuration file that is named main.tf. In this file, you define resources by using HashiCorp Configuration Language.
Return address of where you want the device to be sent to after data transfer is finished.



This request creates a support case to alert the IBM Cloud technicians that the device is being shipped and allows them to track the delivery. When IBM Cloud receives the device, the technicians connect it to the dedicated rack. When the device is connected, the ticket is updated to provide you a link to your logon credentials for the iSCSI target.





 Requesting a return 

If you provided a return address and included the pre-paid shipping label in the packaging, you can request that the device is sent back to you anytime during the two-week transfer period. You can submit the request in the [IBM Cloud console](https://cloud.ibm.com/login).



1. Select Storage > Data Migration > Data Transfer.
2. From the Action menu of your device, select request return.



This update alerts the IBM Cloud technicians that you want the device to be disconnected and sent back to you.





 Requesting an extension 

After your two-week no-cost period, if you still require use of your device you must request an extension in the [IBM Cloud console](https://cloud.ibm.com/login). This update alerts the technicians that you want to extend the time that the device is connected.



1. Select Storage > Data Migration > Data Transfer.
2. In the Action menu for the device, select request extension.



Each extra week incurs a service fee of $25 that must be paid. Your extension request might be denied depending on the available space in the data center. When the request is granted, the ticket is updated.





 Disconnecting the device 

After the two-week period, the device is automatically be disconnected from the data center. If you requested a return, then your device is returned to you by the carrier you chose and to the return address you specified in the initial request. The ticket is updated stating that the device was disconnected. If you didn't request the return of your device, then it is destroyed onsite.
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(scanResult, "", " ")
fmt.Println(string(b))

const params = {
query: 'GST-sdk-',
fields: ['crn'],
searchCursor: searchCursor,
};

globalSearchService.search(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});
2. Extract the value of the CRN field from the response.

{
"items": [
{
"crn": "crn:v1:bluemix:public:cf:au-syd:a/000af2ea12345aabb1234567801fffab::cf-organization:aaaf4100-0011-2233-1111-11aaffee0011"
}
],
"limit": 1,
"search_cursor": "e34535305339jg0rntt39nt3nu5tt9yn3u5ntt329nutt92u4ntt92u4t9u5gt2u5gt92u4n5g982458hg2t45hg9u42rg9t2u49gh285ght28h5t2835th85ht318h4tg9138h4tg91u3hgt931hg45918h34tg18h43hgt31hgt3rng0fnefvodnfvpojdpbojarfdbpojeafrbeafbjeqpnrqngrpqgrhbHNlIiwiY2FuVGFnIjoiZmFsc2UiLCJsdfshfksdhfkshfdkshfdkhkhewrkfehrkhkwhfkwrhkfhrgk3h5k3h45k3hk45hgk3hgk3hfk3h4k3hfkrfh3rkgh3krghk3rgh3kghk3hgk3hgk3rhgdWJsaWM6Y2Y6YXUtwriretoeiroteito4i5ot4i5oyti45ito4tio45ito45io5ogno5iogn5oin5oingoi5o5ngogo4ngo4ngro3jrong3gor3g3gno3jrgo3jrngo3ngro3g32ODQiXX0t"
}
Show more
3. Call the following command:



* Curl
* Java
* Python
* Go
* Node
while (response.getRows().size() > 0) {
List<ViewResultRow> responseDocuments = response.getRows();
System.out.println(responseDocuments);
// The startKeyDocId of the next request becomes the last document id appended with u0000
viewOptionsBuilder.startKeyDocId(
responseDocuments
.get(responseDocuments.size() - 1)
.getId() + 'u0000'
);
response =
service.postView(viewOptionsBuilder.build())
.execute()
.getResult();
}
const { CloudantV1 } = require('@ibm-cloud/cloudant');

const service = CloudantV1.newInstance({});

async function paginate(pageSize) {
let diet = 'herbivore';
let requestParams = {
db: 'animaldb',
ddoc: 'views101',
view: 'diet',
limit: pageSize,
startKey: diet,
endKey: diet,
};
let viewResult = (await service.postView(requestParams)).result;
while (viewResult.rows.length > 0) {
let documents = viewResult.rows;
console.log(documents);
// The startKeyDocId of the next request becomes the last document id appended with u0000
requestParams.startKeyDocId = documentsdocuments.length - 1] .id + 'u0000';
viewResult = (await service.postView(requestParams)).result;
}
}

paginate(3)
import json
from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()
page_size = 3

diet = 'herbivore'
Response<ResourceKey> response = service.createResourceKey(createResourceKeyOptions).execute();
ResourceKey resourceKey = response.getResult();

System.out.printf("createResourceKey() response:n%sn", resourceKey.toString());

parameters = {
'exampleParameter': 'exampleValue'
}
resource_key = resource_controller_service.create_resource_key(
name=key_name,
source=instance_guid,
parameters=parameters
).get_result()

print('ncreate_resource_key() response:n',
json.dumps(resource_key, indent=2))

createResourceKeyOptions := resourceControllerService.NewCreateResourceKeyOptions(
keyName,
instanceGUID,
)

parameters := &resourcecontrollerv2.ResourceKeyPostParameters{}
parameters.SetProperty("exampleParameter", "exampleValue")
createResourceKeyOptions.SetParameters(parameters)

resourceKey, response, err := resourceControllerService.CreateResourceKey(createResourceKeyOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(resourceKey, "", " ")
fmt.Printf("nCreateResourceKey() response:n%sn", string(b))

const parameters = {
'exampleParameter': 'exampleValue'
};

const params = {
name: keyName,
source: instanceGuid,
parameters: parameters,
};

resourceControllerService.createResourceKey(params)
.then(res => {
instanceKeyGuid = res.result.guid;
This status code MAY also be used for security reasons in the scenario [described below](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-status-codessecurity-implications-of-401-and-403). 
 405 [Method Not Allowed](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.5) This code SHOULD be returned when the requested resource doesn't support the request method. When this code is returned the response MUST include the Allow header with the list of accepted request methods for the resource. This code MUST only be used when one of the [Methods](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-methods) documented in this handbook is not valid for a particular URI. See also 501 under [server errors](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-status-codesserver-errors-5xx). <br><br>[7] 
 406 [Not Acceptable](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.6) This code MUST be returned when the resource the client requested is not available in a format allowed by the Accept header the client supplied. 
 408 [Request Timeout](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.7) This code SHOULD be returned when the client took too long to finish sending the request. 
 409 [Conflict](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.8) This code SHOULD be returned when the request cannot be processed because of a conflict between the request and the current client-controlled state in the system. See [Conflicts](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-status-codesconflicts).
"type":"client",
"parameters": {
"<parameter_name>":"<parameter_value>",
"<parameter_name>":"<parameter_value>"
},
"result_variable": "<result_variable_name>"
}
],
"output": {
"text": "response text"
}
}
Show more

The actions array specifies the programmatic calls to make from the dialog. It can define up to five separate programmatic calls. Specify the following name and value pairs in the JSON array:



* <actionName>: Required. The name of the action or service to call. Specify a name in whatever syntax you want. The goal is to specify a name that your client application will recognize and know how to handle. The name cannot be longer than 256 characters.

For example: calculateRate
* <type>: Indicates the type of call to make. Optionally, specify client, which is the default value.

Sends a message response with programmatic call information in a standardized format that your external client application understands. Your client application must use the provided information to run the programmatic call or function, and return the result to the dialog. The JSON object in the response body specifies the service or function to call, any associated parameters to pass with the call, and the format of the result to send back.
* <action_parameters>: Any parameters that are expected by the external program, which are specified as a JSON object. Parameters are only required if the external program requires them.
* <result_variable_name>: The name to use to reference the JSON object that is returned by the external service or program. The result is added to the context section of the /message response. In other words, the result is stored as a context variable so it can be displayed in the node response or accessed by dialog nodes that are triggered later. Any existing value for the context variable is overwritten by the value that is returned by the action. You can specify the result_variable_name by using the following syntax:



* my_result
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(scanResult, "", " ")
fmt.Println(string(b))

const params = {
query: 'GST-sdk-',
fields: ['crn'],
searchCursor: searchCursor,
};

globalSearchService.search(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});
2. Extract the value of the CRN field from the response.

{
"items": [
{
"crn": "crn:v1:bluemix:public:cf:au-syd:a/000af2ea12345aabb1234567801fffab::cf-organization:aaaf4100-0011-2233-1111-11aaffee0011"
}
],
"limit": 1,
"search_cursor": "e34535305339jg0rntt39nt3nu5tt9yn3u5ntt329nutt92u4ntt92u4t9u5gt2u5gt92u4n5g982458hg2t45hg9u42rg9t2u49gh285ght28h5t2835th85ht318h4tg9138h4tg91u3hgt931hg45918h34tg18h43hgt31hgt3rng0fnefvodnfvpojdpbojarfdbpojeafrbeafbjeqpnrqngrpqgrhbHNlIiwiY2FuVGFnIjoiZmFsc2UiLCJsdfshfksdhfkshfdkshfdkhkhewrkfehrkhkwhfkwrhkfhrgk3h5k3h45k3hk45hgk3hgk3hfk3h4k3hfkrfh3rkgh3krghk3rgh3kghk3hgk3hgk3rhgdWJsaWM6Y2Y6YXUtwriretoeiroteito4i5ot4i5oyti45ito4tio45ito45io5ogno5iogn5oin5oingoi5o5ngogo4ngo4ngro3jrong3gor3g3gno3jrgo3jrngo3ngro3g32ODQiXX0t"
}
3. Call the following command:



* Curl
* Java
* Python
* Go
* Node