vania-janet/multiturn-rag-retrieval-data huggingface dataset:
$inputObject->tokenKey = "abc123"; // Primary encryption key
$inputObject->transitionKey = "def987"; // Transition encryption key (optional)
$inputObject->name = "__token__"; // Token name (optional)

$tokenAuth = $client->createTokenAuth($inputObject);
print_r($tokenAuth);
print_r("n");
} catch (Exception $e) {
die('createTokenAuth failed with an exception: ' . $e->getMessage());
}
Show more

The call returns the following object:

SoftLayer_Container_Network_CdnMarketplace_Configuration_Behavior_TokenAuth Object
(
[mappingId] => '351752925563xxx',
[path] => '/private/',
[tokenKey] => 'abc123',
[transitionKey] => 'def987',
[name] => '__token__'
)
terraform init
4. Create a Terraform execution plan. The Terraform execution plan summarizes all of the actions that you must run to create the Continuous Delivery service instance, toolchain resource, and associated IAM access policies in your account.

terraform plan
5. Create the Continuous Delivery service instance, toolchain resource, and associated IAM access policies in your account in IBM Cloud.

terraform apply
6. From the [IBM Cloud resource list](https://cloud.ibm.com/resources), expand the Developer tools section, then select the Continuous Delivery service instance that you created and note the instance ID.
7. Verify that the access policy is successfully assigned. For more information about assigning access policies, see [Reviewing assigned access in the console](https://cloud.ibm.com/docs/account?topic=account-assign-access-resourcesreview-your-access-console).
8. From the [IBM Cloud resource list](https://cloud.ibm.com/resources), expand the Developer tools section, then select the toolchain resource that you created and note the instance ID.
9. Verify that the access policy is successfully assigned.







 What's next? 

Now that you successfully created your first Continuous Delivery service instance and toolchain resource with Terraform on IBM Cloud, you can choose between the following tasks:



* [Deleting a Continuous Delivery service instance](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-delete_cd_service)
* [Using toolchains](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-toolchains-using)
* [Configuring tool integrations](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations)
* [Working with Tekton pipelines](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-tekton-pipelines)
CRN crn:v1:staging:public:is:us-south-3:a/2d1bace7b46e4815a81e52c6ffeba5cf::instance-template:0738-c3809e5b-8d48-4629-b258-33d5b14fa84f
Resource group Default
VPC ID r134-680c56cb-7fbb-41e6-833b-029beb7b6ba3
Image ID r008-54e9238a-feaa-4f90-9742-7424cb2b9ff1
Profile bx2-2x8
Primary Network Interface ID Name Subnet ID Security Groups
primary 0076-2249dabc-8c71-4a54-bxy7-953701ca3999 r134-9fd0b586-6876-4e8a-a0a1-586aeff5167c

If you want to create an instance template from an image shared from a private catalog, replace --image_ID with either --catalog-offering or catalog-offering_version.

For more examples of the ibmcloud is instance-template-create command, see the [VPC CLI reference](https://cloud.ibm.com/docs/vpc?topic=vpc-infrastructure-cli-plugin-vpc-referenceinstance-template-create).

When you create an instance template, validation steps are performed that ensure you can use your template to provision a virtual server instance. Need more help? You can always run ibmcloud is help instance-template-create to display help for creating an instance template.







 Creating an instance group 

After you have your instance template in hand, your next step is to create an instance group. Before you can run the instance-group-create command, you must specify a name for the instance group and determine values for the command options, such as what instance template you want to use.
[IBM Cloud Satellite details](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/cd-only-satellite-Sat-config.png)

Figure 7. IBM Cloud Satellite Config details

Click Continue.







 Step 5: Complete the toolchain setup 

On the Summary page, click Create toolchain. Several steps run automatically to set up your toolchain.

You can configure more toolchain integrations after the pipeline is created.

Zoom

![Toolchain summary](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/cd-only-satellite-summary.png)

Figure 8. Toolchain summary





 Step 6: Explore your new toolchain 

After you create your toolchain, each of the tool integrations that you specified during the setup are displayed.

Zoom

![Example toolchain](https://cloud.ibm.com/docs-content/v1/content/562806c0b18119f4d21cb66f5ae6d051634b4a16/ContinuousDelivery/images/cd-only-satellite-toolchain-created.png)

Figure 9. Example toolchain



 Explore the Delivery Pipeline 

You can explore the Delivery Pipeline to understand the toolchain flow and the different operations that run within the pipeline. The pipeline deploys build artifacts to the deployment environment. The pipeline also verifies the successful deployment of the app by running the health check.

You can start the delivery pipeline in either of the following ways:



* Trigger the delivery pipeline manually.
* Push a commit to the deployment source repo.





 Run the pipeline by using a manual trigger 



1.
For more information, see [Prerequisites for setting up customer-managed encryption](https://cloud.ibm.com/docs/vpc?topic=vpc-vpc-encryption-planning&interface=apibyok-encryption-prereqs).

After the IAM authorizations are set, use the VPC API to [create a file share](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-encryption&interface=apifs-byok-api) with the root key that is owned by the other account. The API calls are the same as when you create an encrypted file share with a root key from your own KMS instance. When you make the POST /shares call, specify the CRN of the root key from the other account in the encryption_key property.

See the following example.

curl -X POST "$vpc_api_endpoint/v1/shares?version=2022-08-09&generation=2" -H "Authorization: $iam_token" -d '{
"encryption_key": {
"crn":"crn:v1:staging:public:kms:us-south:a/df0564dd126042ebb03e0224728ce939:4957299d-0ba0-487f-a1a0-c724a729b8b4:key:0cb88b98-9261-4d07-8329-8f594b6641b5"
},
"iops": 1000,
"name": "my-encrypted-share",
"profile": {
"name": "tier-5iops"
},
"resource_group": {
"id": "678523bcbe2b4eada913d32640909956"
},
"size": 200,
"zone": {
"name": "us-south-2"
}
}'
Show more
For more information about custom images, see [Planning for custom images](https://cloud.ibm.com/docs/vpc?topic=vpc-planning-custom-images).







 Next steps 

After you choose a profile, it's time to plan for and create an instance.



* [Planning for instances](https://cloud.ibm.com/docs/vpc?topic=vpc-vsi_best_practices)
* [Creating an instance by using the UI](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-servers)
* [Creating an instance by using the CLI](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-virtual-servers&interface=cli)
For more information about this feature, see [Encryption in transit - Securing mount connections between file share and host](https://cloud.ibm.com/docs/vpc?topic=vpc-file-storage-vpc-eit). 



* If the share has VPC as the access mode, provide a name for the mount target and Select a VPC from the list.



5. Click Create.









 Create a file share from the CLI 



 Before you begin 



1. Before you can use the CLI, you must install the IBM Cloud CLI and the VPC CLI plug-in. For more information, see the [CLI prerequisites](https://cloud.ibm.com/docs/vpc?topic=vpc-set-up-environmentcli-prerequisites-setup).
2. To use the CLI, set the IBMCLOUD_IS_FEATURE_FILESHARE environment variable to true. Copy the following code:

export IBMCLOUD_IS_FEATURE_FILESHARE=true
3. After you install the VPC CLI plug-in, set the target to generation 2 by running the ibmcloud is target --gen 2 command.
4. Make sure that you [created an IBM Cloud VPC](https://cloud.ibm.com/docs/vpc?topic=vpc-creating-a-vpc-using-clicreate-a-vpc-cli).



As of 30 May 2023, you can use --mount-targets instead of -targets option. To see and use the updated option, set the feature environment variable IBMCLOUD_IS_FEATURE_FILESHARE_CHANGE_TO_MOUNT_TARGETS to true.

export IBMCLOUD_IS_FEATURE_FILESHARE_CHANGE_TO_MOUNT_TARGETS=true





 Gathering information to create file storage from the CLI 

Before you run the ibmcloud is share-create command, you can view information about other file shares, mount targets, and file storage profiles.

Review the following information:



Table 1. Details for creating file shares.

 Details Listing options What it provides
ibmcloud schematics blueprint create -name Blueprint_Basic -resource-group Default -bp-git-url https://github.com/Cloud-Schematics/blueprint-basic-example -bp-git-file basic-blueprint.yaml -input-git-url https://github.com/Cloud-Schematics/blueprint-basic-example -input-git-file basic-input.yaml

On successful completion, the config create returns create_success and the unique ID of the blueprint. This ID is needed as input for all future operations against this environment. For more information, see [blueprint create](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-referenceschematics-blueprint-create) command.



 Verifying blueprint config creation 

Verify that the blueprint configuration was created successfully. When you create the configuration using the CLI, the command displays details of the blueprint modules to be created, and continuously updates the progress of the Schematics jobs initializing the modules. The command only returns on completion.

Created blueprint ID: Blueprint_Basic.eaB.08d1

Modules to be created
SNO Module Type Name
1 Workspace basic-resource-group
2 Workspace basic-cos-storage

Blueprint job us-east.JOB.Blueprint_Basic.4cad1d5b started at 2022-11-18 15:58:34

Module job execution status
Waiting:0 In Progress:0 Success:2 Failed:0

Blueprint job us-east.JOB.Blueprint_Basic.4cad1d5b completed at 2022-11-18 16:00:02

Module Type Name Status Job ID
Blueprint Blueprint_Basic CREATE_SUCCESS us-east.JOB.Blueprint_Basic.4cad1d5b
Workspace basic-resource-group INITIALISED
Workspace basic-cos-storage INITIALISED

Blueprint ID Blueprint_Basic.eaB.08d1 create_success at 2022-11-18 16:00:03
If you want to use a different name, change the toolchain's name.
* The region to create the toolchain in. If you want to use a different region, select it from the list of available regions.
* The resource group to create the toolchain in. If you want to use a different resource group, select it from the list of available resource groups.



2. Enter the requested information in each section of the template, as required. For more information about configuring the tool integrations, see [Configuring tool integrations](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-integrations).
3. Click Create. Several steps run automatically to set up your toolchain. The tool integrations that are set up are different depending on which toolchain template you selected. For example, when you create a DevSecOps Continuous Integration (CI) toolchain, these steps are run:



* The toolchain is created.
* Delivery Pipelines are created and configured based on the information that you provided.
* Source control repositories (repos) are configured for your inventory, compliance evidence, issue tracking, and a sample application for you to get started.
* DevOps Insights and SonarQube are configured to run automatically in your pipeline.
* If you configured a secrets management tool such as IBM® Key Protect for IBM Cloud®, IBM Cloud® Secrets Manager, or HashiCorp Vault, secrets such as API keys are securely stored and retrieved by your pipeline.
* If you configured Slack, the toolchain is set up to send notifications about deployment status to the Slack channel that you specified.





After the toolchain is created, a notification appears that provides a link to a tutorial to learn more about how to use the template.





 Next steps 

Check out the available [toolchain templates and tutorials](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-cd_about).



 Terraform resources and data sources, SDKs, and HTTP APIs
"keys":[{"id": "'$key'"}],
"profile": {
"name": "'$profile_name'"
},
"catalog_offering": {
"offering": {
"crn": "'$offering_crn'"
}
}'
Show more
* Create an instance by using a private catalog image from a specific version of a catalog product offering.

curl -X POST "$vpc_api_endpoint/v1/instances?version=$api_version&generation=2" -H "Authorization:$iam_token" -d '{
"name": "my-instance",
"zone": {
"name": "us-south-3"
},
"vpc": {
"id": "'$vpc'"
},
"primary_network_interface": {
"subnet": {
"id": "'$subnet'"
}
},
"keys":[{"id": "'$key'"}],
"profile": {
"name": "'$profile_name'"
},
"catalog_offering": {
"version": {
"crn": "'$version_crn'"
}
}'
Show more







 Provision from an existing volume 

Reusing an existing, bootable volume is faster than creating a new volume from a snapshot or an image.

You can provision an instance with an existing volume by specifying the existing volume's id or crn subproperty as the value of the boot_volume_attachment property.

The existing, bootable volume must be an unattached bootable volume that has the same operating system and architecture as the instance profile. Use the [list volumes](https://cloud.ibm.com/apidocs/vpc/latestlist-volumes) filter and reference the attachment_state property and operating_system property to view a volume's eligibility.
Image template API reference 

The SoftLayer® Application Programming Interface is the development interface that gives developers and system administrators direct interaction with IBM Cloud® backend system. The SoftLayer API powers many of the features in the IBM Cloud® infrastructure customer portal, meaning that if an interaction is possible in the IBM Cloud infrastructure customer portal, it can also typically be run in the API. Because you can programmatically interact with all portions of the IBM Cloud® environment within the API, SoftLayer API is used to automate tasks. For example, you can use the SoftLayer_Virtual_Guest/createObject API to deploy a virtual server instance from an image template.

The SoftLayer API is a Remote Procedure Call system. Each call involves sending data toward an API endpoint and receiving structured data in return. The format used to send and receive data with the SoftLayer API depends on which implementation of the API you choose. The SoftLayer API currently uses SOAP, XML-RPC or REST for data transmission.

For more information about the SoftLayer API and virtual server APIs, see the following resources in the SoftLayer® Development Network:



* [SoftLayer API Overview ![External link icon](https://cloud.ibm.com/docs-content/v1/content/242c92ec4bec2bd4597959c2a4cd020918ee0c71/icons/launch-glyph.svg)](https://sldn.softlayer.com/reference/softlayerapi/)
* [Getting Started with the SoftLayer API ![External link icon](https://cloud.ibm.com/docs-content/v1/content/242c92ec4bec2bd4597959c2a4cd020918ee0c71/icons/launch-glyph.svg)](https://sldn.softlayer.com/article/getting-started/)
* [API Reference: SoftLayer_Virtual_Guest::createObject !
In the Review configuration side panel, review your settings, then click Accept.

Zoom

![Select Accept to finalize creation of your direct link](https://cloud.ibm.com/docs-content/v1/content/b698ea8660e1f51664f7479f870bbf8840335d06/dl//images/equinix-accept.png)

Select Accept to finalize creation of your direct link
12. After your direct link settings are accepted successfully, select a resource group, routing option, and billing type. Optionally, you can [enable MD5 authentication](https://cloud.ibm.com/docs/dl?topic=dl-enable-disable-md5) to provide additional security for the BGP session, or [update your network connection type](https://cloud.ibm.com/docs/dl?topic=dl-virtual-connection-types).

Review your order summary, agree to the [Direct Link Connect prerequisites](https://cloud.ibm.com/docs/dl?topic=dl-ibm-cloud-dl-prerequisites), and then click Create to complete this order.

Zoom

![Complete your direct link settings, then click Create.](https://cloud.ibm.com/docs-content/v1/content/b698ea8660e1f51664f7479f870bbf8840335d06/dl//images/equinix-create.png)

Complete your direct link settings, then click Create



Your direct link is created:

Zoom

![Completion of your direct link.](https://cloud.ibm.com/docs-content/v1/content/b698ea8660e1f51664f7479f870bbf8840335d06/dl//images/equinix-created.png)

Completion of your direct link
If you want to assign the keystore to a new vault, click Create vault. For more instructions, see [Creating vaults](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-create-vaults).
5. Under Keystore type, select IBM Cloud KMS Keystore and click Next. You can change the currency that is displayed by selecting your country or location.
6. Under Keystore properties, enter a name in Keystore name. Optionally, you can add an extended description to your keystore in the Description section. And then, click Next.

The keystore name must be of 1 to 100 characters in length. The first character must be a letter (case-sensitive) or digit (0-9). The rest can also be symbols (.-_) or spaces. The description can be up to 200 characters in length.
7. Under Summary, you can view the summary of the keystore that you create, including the keystore type, the assigned vault, and general properties.
8. After you confirm the keystore details, click Create keystore to create the keystore.



You have successfully created an internal KMS keystore.





 Creating internal KMS keystores with the API 

To create an internal keystore through the API, follow these steps:



1. [Retrieve your service and authentication credentials to work with keystores in the service](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-set-up-uko-api).
2. Create an internal keystore by making a POST call to the following endpoint.

https://uko.<region>.hs-crypto.cloud.ibm.com:<port>/api/v4/keystores

For detailed instructions and code examples about using the API method, check out the [Hyper Protect Crypto Services Unified Key Orchestrator API reference doc](https://cloud.ibm.com/apidocs/ukocreate-keystore).







 What's next
ibmcloud fn action create my-action action.zip --kind nodejs:16







 Using ES6 module in your action 

If you want to use new ES6 modules in your Actions you will have to create a wrapper function to import the new modules. This wrapper consists of a global variable for your module you want to import and a function which imports the module as a promise.

To load extra more use promise chaining to load further ES6 modules. Add the variable name (let module_name) and the import code to add another ES6 module (.then( () => return import('other_module').then( module => module_name = module.<obj_to_load>))).



1. Create the my-action.js file with the following content.

let uuidv5;

function main(params) {
const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341';

console.log( "uuidv5 = " + uuidv5)

const triggerID = uuidv5('Hello, World!', MY_NAMESPACE);
console.log("----> uuid module successfully loaded and trigger calculated = ", triggerID)

return { message: 'Hello World with id = ' + triggerID };
}

function main_wrapper(params) {

return import('uuid').then(module => uuidv5 = module.v5)
//.then( () => return import('xxxxx').then( module => global_var_yy = module.<obj_to_load>))
.then( () => {
return main( params )
})
}
Show more
2. Create the action and set the main action to main_wrapper.

ibmcloud fn action create my-action my-action.js --main main_wrapper
"operator": "stringEquals"
}
]
}
]
}'

Show more

SubjectAttribute subjectAttribute = new SubjectAttribute.Builder()
.name("iam_id")
.value(EXAMPLE_USER_ID)
.build();
PolicySubject policySubjects = new PolicySubject.Builder()
.addAttributes(subjectAttribute)
.build();
PolicyRole policyRoles = new PolicyRole.Builder()
.roleId("crn:v1:bluemix:public:iam::::role:Editor")
.build();
ResourceAttribute accountIdResourceAttribute = new ResourceAttribute.Builder()
.name("accountId")
.value(exampleAccountId)
.operator("stringEquals")
.build();
ResourceAttribute serviceNameResourceAttribute = new ResourceAttribute.Builder()
.name("serviceType")
.value("service")
.operator("stringEquals")
.build();
PolicyResource policyResources = new PolicyResource.Builder()
.addAttributes(accountIdResourceAttribute)
.addAttributes(serviceNameResourceAttribute)
.build();
CreatePolicyOptions options = new CreatePolicyOptions.Builder()
.type("access")
.subjects(Arrays.asList(policySubjects))
.roles(Arrays.asList(policyRoles))
.resources(Arrays.asList(policyResources))
.build();
Response<Policy> response = service.createPolicy(options).execute();
Policy policy = response.getResult();
System.out.println(policy);
For more information, see Generation in the [Virtual Private Cloud API reference](https://cloud.ibm.com/apidocs/vpcapi-generation-parameter).

A good way to learn more about the API is to click Get sample API call on the provisioning pages in IBM Cloud console. You can view the correct sequence of API requests and better understand actions and their dependencies.





 Create a file share with the API 

Make a POST /shares request to create a file share. Specify the size of the file share, a name, the IOPS profile, and zone.

The following example shows a request to create a 4800 GB file share with a 10 IOPS/GB profile. It specifies the access control mode vpc, which enables all clients in each mount target's VPC to have access to this file share.

curl -X POST "$vpc_api_endpoint/v1/shares?version=2023-07-11&generation=2&maturity=beta" -H "Authorization: $iam_token" -d '{
"size": 4800,
"name": "myshare-1",
"profile": {
"name": "tier-10iops"
},
"access_control_mode": "vpc",
"zone": {
"name": "us-south-1"
}
}'

A successful response looks like the following example.

{
"access_control_mode": "vpc",
"created_at": "2023-07-11T22:31:50Z",
"crn": "crn": "crn:[...]",
"encryption": "provider_managed",
"href": "https://us-south.iaas.cloud.ibm.com/v1/shares/acd96d70-b8d3-4b56-ad7f-9c1035df93b2",
Creating an image template 

Complete the following steps to create an image template of a virtual server.



1. Go to your console's device menu and make sure that you have the correct account permissions to complete the tasks.
2. From the Devices menu, select Device List.
3. Click the virtual server that you want to use to create an image template.

Check the Passwords tab of the Device Details page. Ensure that any passwords listed on the Device Details page match the actual operating system passwords and any other software add-on passwords. If passwords do not match, virtual servers that are created from this image template fail.
4. From the Actions menu, select Create Image Template and complete the required fields.



For more information, see [Creating an image template](https://cloud.ibm.com/docs/image-templates?topic=image-templates-creating-an-image-template).





 Next steps 

After the image template is created, you can [order more virtual servers](https://cloud.ibm.com/docs/image-templates?topic=image-templates-ordering-an-instance-from-an-image-template) based on the template. Your new virtual servers have the same configurations that are included in the image template.