vania-janet/multiturn-rag-retrieval-data huggingface dataset:
8afde05e-5fd8-4359-a597-946d8432dd45
3. Get the IAM token. For instructions, see [steps](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-retrieve-iam-token-serverless).
4. Create an instance by using the Resource controller REST API:

curl -X POST https://resource-controller.cloud.ibm.com/v2/resource_instances/
--header "Authorization: Bearer $token" -H 'Content-Type: application/json' -d @provision.json

The provision.json file contains the provisioning parameters for the instance that you want to create. See [Architecture and concepts in serverless instances](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-serverless-architecture-concepts) for a description of the provisioning parameters in the payload.

Following is a sample of the provision.json file.

{
"name": "your-service-instance-name",
"resource_plan_id": "8afde05e-5fd8-4359-a597-946d8432dd45",
"resource_group": "resource-group-id",
"target": "us-south",
"parameters": {
"default_runtime": {
"spark_version": "3.3"
},
"instance_home": {
"region": "us-south",
"endpoint": "s3.direct.us-south.cloud-object-storage.appdomain.cloud",
"hmac_access_key": "your-access-key",
"hmac_secret_key": "your-secret-key"
}
}
}
Show more
5.
Retrieving service endpoints 

The service endpoints that the cluster exposes are made available to you as service keys (also known as service credentials).

You can fetch the service endpoints by:



* [Using the IBM Cloud CLI](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-retrieve-endpoints-serverlessendpoints-cli)
* [Using the IBM Cloud REST API](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-retrieve-endpoints-serverlessendpoints-api)
* [From the IBM Cloud console](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-retrieve-endpoints-serverlessendpoints-console)



The service endpoints do not expose the instance credentials. To get the instance credentials, see [Retrieving cluster credentials](https://cloud.ibm.com/docs/services/AnalyticsEngine?topic=AnalyticsEngine-retrieve-cluster-credentials).



 Obtaining the service endpoints using the IBM Cloud CLI 

You need to create a service key for the IBM Analytics Engine serverless instance to obtain the service endpoints.

To create a service resource key, enter the following command:

ibmcloud resource service-key-create <your_service_key_name> <role> --instance-name <your_service_instance_name>

Required parameters include:



* <your_service_instance_name>: the name of the service instance you specified when creating the cluster. You can check your [IBM Cloud resource list](https://cloud.ibm.com/resources) to find your service instance names.
* <your_service_key_name>: any name that you want to use for the key. This name is used to retrieve service keys.
* <role>: the role you assigned to the IAM API key which was generated for the service credentials. You will be able to perform only those operations that are permitted for the chosen role.
"history_server_api":"https://spark-console.us-south.ae.cloud.ibm.com/v3/analytics_engines/xxxx-3bxxxbc-4xxx1-axx6-8xxdxx0xxd/spark_history_api/v1"
},
"iam_apikey_description": "Auto-generated for key cabde209-xxxx",
"iam_apikey_name": "Service credentials-1",
"iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Reader",
"iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/xxxxx::serviceid:ServiceId-2fec11aa-xxxx-4918-xxxx-aa3650f99050"
}
Show more

In the sample response, the properties under endpoints specify the service endpoints. The property iam_apikey_name contains an IAM API key that can be used to generate IAM bearer tokens. An IAM bearer token must be provided for authorization when invoking the REST APIs for IBM Analytics Engine serverless instances.





 Obtaining the service endpoints using the IBM Cloud REST API 

Prerequisite: You need an IAM bearer token. For more information, see [Retrieving IAM access tokens](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-retrieve-iam-token).

The API endpoint that handles API service keys is https://resource-controller.cloud.ibm.com/v1/resource_keys.

To create a service resource key, enter:
curl -X GET https://resource-controller.cloud.ibm.com/v2/resource_instances? resource_plan_id=8afxxxx-xxxx-xxxx-xxxx-946d843xxxx -H "Authorization: Bearer <>"

Example response:

{
"rows_count": 1,
"next_url": null,
"resources": [{
"id": "crn:v1:staging:public:ibmanalyticsengine:us-south:a/d628eae2ccxxxx3bb0c9dxxxx:da82xxxx-xxxx-xxxx-xxxx-d0faf90exxxx::",
"guid": "da82xxxx-xxxx-xxxx-xxxx-d0faf90exxxx",
"url": "/v2/resource_instances/da82xxxx-xxxx-xxxx-xxxx-d0faf90exxxx",
"created_at": "2021-08-05T11:05:51.545526066Z",
"updated_at": "2021-11-04T05:11:30.966202521Z",
"deleted_at": null,
"created_by": "IBMid-661002042N",
"updated_by": "",
"deleted_by": "",
"scheduled_reclaim_at": null,
"restored_at": null,
"scheduled_reclaim_by": "",
"restored_by": "",
"name": "serverless-instance",
"region_id": "us-south",
"account_id": "d628eae2ccxxxx3bb0c9dxxxx",
"reseller_channel_id": "",
"resource_plan_id": "8afxxxx-xxxx-xxxx-xxxx-946d843xxxx",
});

options.serviceUrl = IAE_ENDPOINT_URL;
options.serviceName = DEFAULT_SERVICE_NAME;

// Construct the service client.
const ibmAnalyticsEngineApiService = new IbmAnalyticsEngineApiV3.newInstance(options);
Show more

Key values:



* serviceUrl: public endpoint to the IBM Analytics Engine instance. See [Service endpoints](https://cloud.ibm.com/apidocs/ibm-analytics-engineservice-endpoints).
* apikey: API key generated when creating the service credentials. Write access is required for creation and deletion tasks.



* Retrieve the details of a single instance:

getInstance(params)

Example request:

const params = {
instanceId: 'e64c907a-e82f-46fd-addc-ccfafbd28b09',
};
ibmAnalyticsEngineApiService.getInstance(params)
.then((res) => {
console.log(JSON.stringify(res.result, null, 2));
}).catch((err) => {
console.warn(err);
});
* Deploy a Spark application on a given serverless Spark instance:

createApplication(params)

Example request:

// ApplicationRequestApplicationDetails
const applicationRequestApplicationDetailsModel = {
application: '/opt/ibm/spark/examples/src/main/python/wordcount.py',
arguments: ['/opt/ibm/spark/examples/src/main/resources/people.txt'],
};

ibmAnalyticsEngineApiService.createApplication({
instanceId: 'e64c907a-e82f-46fd-addc-ccfafbd28b09',
"start_time" : "2021-04-21T04:24:01Z",
"end_time" : "2021-04-21T04:28:15Z",
"finish_time" : "2021-04-21T04:28:15Z",
"auto_termination_time" : "2021-04-24T04:24:01Z"
}









 Log forwarding configuration 

Use this command to enable or disable forwarding of logs from a serverless instance to an IBM Log Analysis service and to view the status of the log forwarding configuration.

ibmcloud analytics-engine-v3 log-forwarding-config --help



 ibmcloud analytics-engine-v3 log-forwarding-config replace 

Modify the configuration for forwarding logs from the Analytics Engine instance to IBM Log Analysis server. Use this endpoint to enable or disable log forwarding.

ibmcloud analytics-engine-v3 log-forwarding-config replace [--instance-id INSTANCE-ID] --enabled ENABLED [--sources SOURCES] [--tags TAGS]



 Command options 

-i, --instance-id (string)
: ID of the Analytics Engine instance. When specified, it overrides the target instance ID if it was set. Required, if the target instance was not set.

The value must match the regular expression /u0008[0-9a-f]{8}u0008-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-u0008[0-9a-f]{12}u0008/.

--enabled (bool)
: Enable or disable log forwarding. Required.

--sources ([]string)
: List of sources of logs that will be forwarded. By default, only 'spark-driver' logs are forwarded.

--tags ([]string)
: List of tags to be applied to the logs being forwarded.
The virtual server instance has an ID of 0777_e7af506a-35d4-451d-aa9e-59330e62b77e. The --force option indicates that the request for confirmation is skipped.

ibmcloud is instance-stop 0777_e7af506a-35d4-451d-aa9e-59330e62b77e --force

A Force stop action triggers a power cycle reset of the virtual server instance.

If you have an instance that gets stuck in a stopping state, you can use the following example command with the --force and --no-wait options specified to stop the instance immediately without confirmation. The instance has an ID of 0757_5446c277-3190-48dd-ac67-5f02fab39ed5. The --force option indicates that the request for confirmation is skipped. The --no-wait option runs the command immediately, dropping any queued actions.

ibmcloud is instance-stop 0757_5446c277-3190-48dd-ac67-5f02fab39ed5 --force --no-wait

For a full list of command options, see [ibmcloud is instance-stop](https://cloud.ibm.com/docs/vpc?topic=vpc-vpc-referenceinstance-stop).





 Start a virtual server instance using the CLI 

You can start a virtual server instance that is stopped in your IBM Cloud VPC by using the command-line interface (CLI).

To start the virtual server instance by using the CLI, use the ibmcloud is instance-start command. Specify the ID or name of the virtual server instance that you want to start by using the INSTANCE variable.

ibmcloud is instance-start INSTANCE

For a full list of command options, see [ibmcloud is instance-start](https://cloud.ibm.com/docs/vpc?topic=vpc-vpc-referenceinstance-start).





 Stop a virtual server instance using the API
For z/OS virtual server instances only: You must shut down all the subsystems in the z/OS system to halt the virtual server instance. For more information, see [Shutting down z/OS virtual server instances](https://www.ibm.com/docs/en/wazi-aas/1.0.0?topic=vpc-shutting-down-zos-virtual-server-instances).





 Stop a virtual server instance using the CLI 

You can stop the virtual server instance in your IBM Cloud VPC by using the command-line interface (CLI).

To stop the virtual server instance by using the CLI, use the ibmcloud is instance-stop command. Specify the ID or name of the virtual server instance that you want to stop with the INSTANCE variable.

ibmcloud is instance-stop INSTANCE

The stop action shuts down the guest operating system and then the virtual server instance is deprovisioned. This change frees the instance resources that were being consumed. The virtual server instance is transitioned to the Stop state. If the instance is stopped, the instance remains in the stopped state and must be started manually. Billing is [suspended](https://cloud.ibm.com/docs/vpc?topic=vpc-suspend-billing) for some compute resources while the instance is stopped. You cannot interact with an instance if it is stopped, but volumes remain provisioned. If the instance is started, normal interaction and billing continues.

The following example stops an instance without requesting confirmation. The virtual server instance has an ID of 0777_e7af506a-35d4-451d-aa9e-59330e62b77e. The --force option indicates that the request for confirmation is skipped.

ibmcloud is instance-stop 0777_e7af506a-35d4-451d-aa9e-59330e62b77e --force

A Force stop action triggers a power cycle reset of the virtual server instance.
Understanding the command components

 Option Description 

 <namespace_service_ID> The service ID for the namespace. To see all service IDs, run ibmcloud iam service-ids. 
 <IAM_role> The type of IAM service access role that the action must have to use the target service. To see the supported roles for the other service, run ibmcloud iam roles --service SERVICE_NAME. For more information, see [IAM access roles](https://cloud.ibm.com/docs/account?topic=account-userrolesservice_access_roles). 
 --service-name <other_service_name> The name of the other IBM Cloud service name. 
 --service-instance <other_service_GUID> The GUID of the other service instance that you want the action to have access to. To get the service instance GUID, run ibmcloud resource service-instance <other_service_instance_name>. 



For more information, see the [service-policy-create](https://cloud.ibm.com/docs/account?topic=cli-ibmcloud_commands_iam) command reference.

Next steps
: For more information about managing service credentials, see the [Manage service credentials for serverless applications](https://developer.ibm.com/tutorials/accessing-iam-based-services-from-ibm-cloud-functions/) blog.
By default, a boot volume is attached to the instance when the instance is created. For most virtual server instances, the default boot volume size is 100 GB. The default boot volume size for a z/OS virtual server instance is 250 GB.



1. Create an instance by using the following command.

ibmcloud is instance-create INSTANCE_NAME VPC ZONE_NAME PROFILE_NAME SUBNET --image IMAGE --keys KEYS

For example, the following instance-create command uses the sample values that are found in the [Gathering information](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-serversgather-info-to-create-virtual-servers-cli) section.

ibmcloud is instance-create my-instance r134-35b9cf35-616e-462e-a145-cf8db4062fcf us-south-2 bx2-2x8 0726-198db988-3b9b-4cfa-9dec-0206420d37d0 --image r134-f83ce520-00b5-40c5-9938-a5c82a273f91 --keys r134-89ec781c-9630-4f76-b9c4-a7d204828d61

Where the following argument and option values are used



* INSTANCE_NAME: my-instance
* VPC: r134-35b9cf35-616e-462e-a145-cf8db4062fcf
* ZONE_NAME: us-south-2
* PROFILE_NAME: bx2-2x8
* SUBNET: 0726-198db988-3b9b-4cfa-9dec-0206420d37d0
* IMAGE: Debian 11 image r134-f83ce520-00b5-40c5-9938-a5c82a273f91
* --name: New name of the virtual server instance.
* --profile: The profile to use for this virtual server instance. To change the profile, the instance status must be stopping or stopped. In addition, the requested profile must: 1. Match the current profile's instance disk support. (Note: If the current profile supports instance storage disks, the requested profile can have a different instance storage disk configuration.) 2. Be compatible with any placement target constraints. For example, if the instance is placed on a dedicated host, the requested profile family must be the same as the dedicated host family.
* --total-volume-bandwidth: The amount of bandwidth (in megabits per second) that is allocated exclusively to instance storage volumes. An increase in this value results in a corresponding decrease to total network bandwidth.
* --dedicated-host: ID or name of the host destination where the instance is placed.
* --dedicated-host-group: ID or name of the host group destination where the instance is placed.
* --metadata-service, --ms: Enable or disable the Instance Metadata Service. One of: true, false.
* --metadata-service-protocol, --msp: The communication protocol for the metadata service endpoint. Applies only when the metadata service is enabled. One of: http, https. (default: http).
* --metadata-service-response-hop-limit, --msrhl: The hop limit (IP time to live) for IP response packets from the metadata service.
* --host-failure-policy: The action to perform if the compute host experiences a failure. One of: restart, stop.
* --output: Specify output format, only JSON is supported. One of: JSON.
* -q, --quiet: Suppress verbose output.



--------------------







 ibmcloud is instance-volume-attachment 

View details of a volume attachment.

ibmcloud is instance-volume-attachment INSTANCE VOLUME_ATTACHMENT [--output JSON] [-q, --quiet]



 Command options
IBM Cloud services that generate platform logs 

List of IBM Cloud® services that send logs to IBM Log Analysis:

You can define only 1 instance per region where IBM Log Analysis is supported with the flag Platform logs.



 Analytics services 

The following table lists services that send logs to IBM Log Analysis:



Table 1. List of analytics services

 Service Description More info 

 [IBM Planning Analytics as a Service](https://cloud.ibm.com/docs/planning-analytics?topic=planning-analytics-about) IBM Planning Analytics as a Service is a fully-managed and collaborative service that provides enterprise-level budgeting, planning, modeling, and reporting solutions. [More info](https://cloud.ibm.com/docs/planning-analytics?topic=planning-analytics-logging) 



You can monitor logs through the Log Analysis instance that is configured to receive platform services logs in the location where the service is running.

To see the list of IBM Log Analysis locations where these services send logs, see [Security services](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-cloud_services_locationscs_locations_analytics).





 Compute serverless services 

The following table lists services that send logs to IBM Log Analysis:



Table 2. List of serverless compute services

 Service Description More info 

 [IBM Cloud® Functions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-getting-started) Cloud Functions is a polyglot Functions-as-a-Service (FaaS) programming platform based on Apache OpenWhisk that you can use to write lightweight code called actions. [More info](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-logs)
Storage Optimized profiles options for Intel x86-64 virtual server instances.

 Instance profile vCPU Cores GiB RAM Bandwidth Cap (Gbps) Instance Storage (GB) Interface Type 

 ox2-2x16 2 1 16 4 1x600 virtio_blk 
 ox2-4x32 4 2 32 8 1x1200 virtio_blk 
 ox2-8x64 8 4 64 16 2x1200 virtio_blk 
 ox2-16x128 16 8 128 32 2x2400 virtio_blk 
 ox2-32x256 32 16 256 64 3x3200 virtio_blk 
 ox2-64x512 64 32 512 80 6x3200 virtio_blk 
 ox2-96x768 96 48 768 80 9x3200 virtio_blk 
 ox2-128x1024 128 64 1024 80 12x3200 virtio_blk 







 Bandwidth allocation 



 Bandwidth allocation between storage and networking 

Instance bandwidth is allocated between volume bandwidth and networking bandwidth. The bandwidth capacity (Bandwidth Cap) is determined by the virtual server profile that you select during instance provisioning. For example, a bx2-2x8 balanced server profile allows a bandwidth cap of 4 Gbps. The initial volume and network bandwidth allocation depends on the bandwidth set by the instance profile you selected. You can also see the bandwidth allocations in the profile information during instance creation in the UI. The bandwidth allocation can be changed on the instance details page after provisioning an instance.

For example, for the bx2-2x8 profile you might have:



* Storage: 1 Gbps
* Network: 3 Gbps



For a cx2-8x16 profile:



* Storage: 4 Gbps
* Network: 12 Gbps



The amount of overall bandwidth provided to volume bandwidth can be adjusted within the overall instance limits. A default amount of volume bandwidth is set on each instance profile.
Instance bandwidth is allocated between volume bandwidth and networking bandwidth. The bandwidth capacity (Bandwidth Cap) is determined by the virtual server profile that you select during instance provisioning. For example, a bx2-2x8 balanced server profile allows a bandwidth cap of 4 Gbps. The initial volume and network bandwidth allocation depends on the bandwidth set by the instance profile you selected. You can also see the bandwidth allocations in the profile information during instance creation in the UI. The bandwidth allocation can be changed on the instance details page after provisioning an instance.

For example, for the bz2-2x8 profile you might have:



* Storage: 1 Gbps
* Network: 3 Gbps



For a cz2-8x16 profile:



* Storage: 4 Gbps
* Network: 12 Gbps



The amount of overall bandwidth provided to volume bandwidth can be adjusted within the overall instance limits. A default amount of volume bandwidth is set on each instance profile.

For more information, see [Bandwidth allocation for instance profiles](https://cloud.ibm.com/docs/vpc?topic=vpc-bandwidth-allocation-profiles) and [Adjusting bandwidth allocation using the UI](https://cloud.ibm.com/docs/vpc?topic=vpc-managing-virtual-server-instances&interface=uiadjusting-bandwidth-allocation-ui).





 How the bandwidth is allocated using the API 

Instance bandwidth is allocated between volume bandwidth and networking bandwidth. The bandwidth capacity (Bandwidth Cap) is determined by the virtual server profile that you select during instance provisioning. For example, a bz2-2x8 balanced server profile allows a bandwidth cap of 4 Gbps. The initial volume and network bandwidth allocation depends on the bandwidth you set by using the API or by the instance profile you selected. You can see bandwidth allocations with the /instance/profiles endpoint in the API. The bandwidth can be changed during or after provisioning an instance.

For example, for the bz2-2x8 profile you might have:



* Storage: 1 Gbps
* Network: 3 Gbps



For a cz2-8x16 profile:



* Storage: 4 Gbps
Select the HPVS instance for '--instance'

Select a virtual server:
1. hpnet-test1 - crn:v1:staging:public:hpvs:dal10:a/9f63166137084e9d9131e42bfce481a6:8ba48f91-ef4a-4433-b411-fd8b2becc18b::
2. hpnet-test2 - crn:v1:staging:public:hpvs:dal10:a/9f63166137084e9d9131e42bfce481a6:1b763c10-2970-48aa-88d8-9c63fb66cc7d::
Enter a number>

Enter number 1 to select hpnet test1, you are then prompted to enter a passphrase to encrypt the private key:

ibmcloud hpnet adminkey set --instance "hpnet test1"

Generating public/private ed25519 key pair for the admin of hpnet-test1...

Enter passphrase of the private key>
Enter same passphrase again>
OK

Enter a passphrase that you can remember. If you are doing this the first time, the CLI prompts you to authenticate the Hyper Protect Virtual Servers instance, to verify if the server side certification is trusted. If the server side certification is trusted, the fingerprint of the server certification is recorded in the local file ($HOME/.hpnet-cfg/known_instances), this avoids repeated authentication requests in subsequently run commands:

Starting to encrypt key '/Users/hexiaohu/.hpnet-cfg/temp/hpnet-test1-83-92-b6-4b.priv.tmp'....

Connecting to the server hpnet-test1 [52.117.54.147] ...

Verify the connecting server’s certificate before connecting:
By default, a boot volume is attached to the instance when the instance is created. For most virtual server instances, the default boot volume size is 100 GB. The default boot volume size for a z/OS virtual server instance is 250 GB.



1. Create an instance by using the following command.

ibmcloud is instance-create INSTANCE_NAME VPC ZONE_NAME PROFILE_NAME SUBNET --image IMAGE --keys KEYS

For example, the following instance-create command uses the sample values that are found in the [Gathering information](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-servers&interface=cligather-info-to-create-virtual-servers-cli) section.

ibmcloud is instance-create my-instance r134-35b9cf35-616e-462e-a145-cf8db4062fcf us-south-2 bx2-2x8 0726-198db988-3b9b-4cfa-9dec-0206420d37d0 --image r134-f83ce520-00b5-40c5-9938-a5c82a273f91 --keys r134-89ec781c-9630-4f76-b9c4-a7d204828d61

Where the following argument and option values are used



* INSTANCE_NAME: my-instance
* VPC: r134-35b9cf35-616e-462e-a145-cf8db4062fcf
* ZONE_NAME: us-south-2
* PROFILE_NAME: bx2-2x8
* SUBNET: 0726-198db988-3b9b-4cfa-9dec-0206420d37d0
* IMAGE: Debian 11 image r134-f83ce520-00b5-40c5-9938-a5c82a273f91
By default, a boot volume is attached to the instance when the instance is created. For most virtual server instances, the default boot volume size is 100 GB. The default boot volume size for a z/OS virtual server instance is 250 GB.



1. Create an instance by using the following command.

ibmcloud is instance-create INSTANCE_NAME VPC ZONE_NAME PROFILE_NAME SUBNET --image IMAGE --keys KEYS

For example, the following instance-create command uses the sample values that are found in the [Gathering information](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-servers&interface=terraformgather-info-to-create-virtual-servers-cli) section.

ibmcloud is instance-create my-instance r134-35b9cf35-616e-462e-a145-cf8db4062fcf us-south-2 bx2-2x8 0726-198db988-3b9b-4cfa-9dec-0206420d37d0 --image r134-f83ce520-00b5-40c5-9938-a5c82a273f91 --keys r134-89ec781c-9630-4f76-b9c4-a7d204828d61

Where the following argument and option values are used



* INSTANCE_NAME: my-instance
* VPC: r134-35b9cf35-616e-462e-a145-cf8db4062fcf
* ZONE_NAME: us-south-2
* PROFILE_NAME: bx2-2x8
* SUBNET: 0726-198db988-3b9b-4cfa-9dec-0206420d37d0
* IMAGE: Debian 11 image r134-f83ce520-00b5-40c5-9938-a5c82a273f91