vania-janet/multiturn-rag-retrieval-data huggingface dataset:
void printEventLogs(List<Log> logs){
for (Log event :logs) {
System.out.println(String.format("%s - %s - %s",
event.getEventName(),
event.getEventCreateDate().getTime(),
event.getUserType()));
}
}
}

import datetime
import SoftLayer

class example():

def __init__(self):

self.client = SoftLayer.Client()
debugger = SoftLayer.DebugTransport(self.client.transport)
self.client.transport = debugger

def recentLogs(self):
"""REST API CALL
'https://api.softlayer.com/rest/v3.1/SoftLayer_Event_Log/getAllObjects.json?
resultLimit=0,50&
objectFilter={"eventCreateDate":{"operation":"greaterThanDate","options":[{"name":"date","value":"2018-04-18T00:00:00.0000-06:00"]}]}}'
"""
_filter = {
'eventCreateDate': {
'operation': 'greaterThanDate',
'options': [
{'name': 'date', 'value': getDateString(30)]}
]
}
}
for event in self.getAllObjects(_filter):
printLogs(event)

def systemLogs(self):
"""REST API CALL
'https://api.softlayer.com/rest/v3.1/SoftLayer_Event_Log/getAllObjects.json?
resultLimit=0,50&
objectFilter={"userType":{"operation":"SYSTEM"}}'
"""
Transport node type Uplink profile IP assignment 

 ESXi esxi-private-profile <br>esxi-public-profile tep-pool 
 Gateway cluster edge-private-profile <br>edge-public-profile <br>edge-tep-profile <br>mgmt-edge-private-profile <br>mgmt-edge-public-profile <br>mgmt-edge-tep-profile tep-pool 







 Uplink profiles and teaming 

An uplink profile defines policies for the links from hypervisor hosts to NSX-T logical switches or from NSX Edge nodes to top-of-rack switches.



Table 9. NSX-T uplink profiles

 Uplink profile name VLAN Teaming policy Active uplinks Standby links MTU 

 esxi-private-profile default Default - Loadbalance source uplink-1 <br>uplink-2 Managed by vCenter Server 
 esxi-private-profile default TEP - Failover order uplink-1 uplink-2 Managed by vCenter Server 
 esxi-public-profile default Default - Loadbalance source uplink-1 <br>uplink-2 Managed by vCenter Server 
 edge-private-profile default uplink-1 9000 
 edge-public-profile default uplink-1 1500 
 edge-tep-profile default Failover order uplink-1 9000 
 mgmt-edge-private-profile default uplink-1 9000 
 mgmt-edge-public-profile default uplink-1 1500 
 mgmt-edge-tep-profile default Failover order uplink-1 9000 







 VNI pools 

Virtual Network Identifiers (VNIs) are similar to VLANs to a physical network. They are automatically created when a logical switch is created from a pool or range of IDs. This design uses the default VNI pool that is deployed with NSX-T.





 Segments 

An NSX-T segment reproduces switching functions, broadcast, unknown unicast, multicast (BUM) traffic, in a virtual environment that is decoupled from the underlying hardware.



Table 10. NSX-T logical switches

 Segment name VLAN Transport zone Uplink teaming policy
IA-3 - Device Identification and Authentication 



  Control requirements 

IA-3 - 0
:   The information system uniquely identifies and authenticates [Assignment: organization-defined specific and/or types of devices] before establishing a [Selection (one or more): local; remote; network] connection.





  Additional IBM Cloud for Financial Services specifications 



*  All devices must be authorized by organization security prior to allowing such network connections.







  IBM Cloud for Financial Services profile 

The rules related to this control that follow are part of the IBM Cloud for Financial Services v1.2.0 profile in [IBM Cloud® Security and Compliance Center](https://cloud.ibm.com/docs/security-compliance?topic=security-compliance-getting-started).



*  Check whether authorized IP ranges are configured for the account
*  Check whether IBM Cloud VPC uniquely identifies all physical devices before accepting a network connection







  NIST supplemental guidance 

Organizational devices requiring unique device-to-device identification and authentication may be defined by type, by device, or by a combination of type/device. Information systems typically use either shared known information (e.g., Media Access Control [MAC] or Transmission Control Protocol/Internet Protocol [TCP/IP] addresses) for device identification or organizational authentication solutions (e.g., IEEE 802.1x and Extensible Authentication Protocol [EAP], Radius server with EAP-Transport Layer Security [TLS] authentication, Kerberos) to identify/authenticate devices on local and/or wide area networks. Organizations determine the required strength of authentication mechanisms by the security categories of information systems. Because of the challenges of applying this control on large scale, organizations are encouraged to only apply the control to those limited number (and type) of devices that truly need to support this capability.
When you're creating service instances on IBM Cloud, one of the required parameters your users provide is the location where they want that service instance to be created. Some services can support creation in multiple locations. For example, a database service can support creation in all IBM Cloud regions or it can support a subset.

If your third-party API-based service is implemented in another cloud and exposed into IBM Cloud, the location indicates the service's location in the other cloud.

When you onboard to IBM Cloud, you must implement at least one OSB broker. You can have more than one broker depending on your deployment strategy and the locations you want to support for your service. Within Partner Center Sell, you establish the mapping between your pricing plan and the broker. The typical choices are to define a single broker to service all locations for your service or to define a broker per location; this choice is up to the service provider.

For a list of available locations, review the [IBM global catalog locations](https://globalcatalog.cloud.ibm.com//search?q=kind:geography). If your service requires more locations to be defined, consult the IBM Cloud onboarding team.









 Hosting your brokers 

Your broker must be hosted as part of an application that can respond to REST API calls and your hosted location must meet IBM Cloud security guidelines. You might host your broker in IBM Cloud, or it can be hosted externally, if it's publicly accessible from IBM Cloud itself.

To host your broker outside of IBM, you must ensure that it meets the following security guidelines:



* Must follow Transport Layer Security (TLS) protocol version 1.2. For more information, see [TLS protocol overview](https://www.ibm.com/docs/en/sdk-java-technology/8?topic=provider-tls-protocol-overview).
* Must be hosted on a valid HTTPs endpoint that is accessible on the public internet







 Testing your service's broker 

You must validate your broker by running curl commands against the different endpoints that you enable. You need the hosted location of your service broker and the URL and credentials that are associated with your application. To test your broker, use the following methods:
],
"text": "vehicle",
"type": "Transportation"
}
]
}
]
}
Show more





 Uploading dictionary terms 

To add dictionary from a CSV file, complete the following steps:



1. Create a CSV file that contains the dictionary terms that you want to add.

Use UTF-8 encoding. Specify one entry per line.



* To define a set of synonymous terms, use the following syntax:

<term>,<synonym>,<synonym>,<synonym>,...

For example:

vehicle,car,automobile,sedan,convertible,station wagon

The entry in this example creates a vehicle dictionary entry. When the dictionary enrichment is applied to a document, any mentions of vehicle, car, automobile, sedan, convertible, or station wagon are tagged as instances of the vehicle dictionary entry.
* To define a set of terms in the same category, use the following syntax:

<category>,<related-term>,<related-term>,...

For example:

engine,gasket,carburetor,piston,valves

The entry in this example creates an engine dictionary entry. When the dictionary enrichment is applied to a document, any mentions of engine,gasket,carburetor,piston, or valves are tagged as instances of the engine dictionary entry.



2. From the Teach domain concepts section of the Improvement tools panel, choose Dictionaries.
3. Click Upload.
4. Name your dictionary and choose the language that was used in the CSV file.
5. Optional: Expand Advanced options, and specify edit the facet name for the dictionary. Facets are used to categorize documents. A user can choose a facet type to narrow their search. The dictionary name in lowercase is used as the facet name by default. You might want to change the facet to be uppercase.
6. Click Upload to browse for the CSV file that you created earlier.
7. Click Create.
8.
Deploy isolated workloads across multiple locations and zones 

This tutorial may incur costs. Use the [Cost Estimator](https://cloud.ibm.com/estimator/review) to generate a cost estimate based on your projected usage.

This tutorial walks you through steps for setting up highly available and isolated workloads by provisioning IBM Cloud® Virtual Private Clouds (VPCs). You will create virtual server instances (VSIs) in multiple zones within one region to ensure the high availability of the application. You will create additional VSIs in a second region and configure a global load balancer (GLB) to provide high availability between regions and reduce network latency for users in different geographies.

You will provision an IBM Cloud Internet Services (CIS) service as the GLB from the catalog, and an IBM Cloud Secrets Manager service from the catalog to manage the Transport Layer Security (TLS) certificate for all incoming HTTPS requests.



 Objectives 



* Understand the isolation of workloads through infrastructure objects available for virtual private clouds.
* Use a load balancer between zones within a region to distribute traffic among virtual servers.
* Use a global load balancer between regions to implement high availability, increase resiliency and reduce latency.



Zoom

![Architecture](https://cloud.ibm.com/docs-content/v1/content/f02b9c9adcbb7328d95a45e105cec371d50f15eb/vpc/includes/solution-tutorials/includes/solution-tutorials/images/solution41-vpc-multi-region/vpc-multi-region-architecture.svg)

Figure 1. Architecture diagram of the tutorial



1. The admin (DevOps) provisions VSIs in subnets under two different zones in a VPC in region 1 and repeats the same in a VPC created in region 2.
2. The admin creates a load balancer with a backend pool of servers in different zones of region 1 and a frontend listener. Repeats the same in region 2.
3.
This helps clients that must use an IP to access the application/service served by the load balancer. It also helps with faster recovery in the event of failures compared to a DNS-based availability that the application load balancer uses.



The following table provides a comparison of the types of load balancers.



Table 1. Comparison of network and application load balancers

 Network load balancer Application load balancer 

 HA mode Active-standby (with single VIP) Active-active (with multiple VIPs assigned to a DNS name) 
 Instance group support No Yes (see [Integrating an ALB for VPC with instance groups](https://cloud.ibm.com/docs/vpc?topic=vpc-lbaas-integration-with-instance-groups)) 
 Monitoring metrics Yes Yes 
 Multi-zone support Yes <br><br>[1]<br><br> (see [Multi-zone support](https://cloud.ibm.com/docs/vpc?topic=vpc-network-load-balancersnlb-use-case-2)) Yes 
 Security group support No Yes (see [Integrating an ALB for VPC with security groups](https://cloud.ibm.com/docs/vpc?topic=vpc-alb-integration-with-security-groups)) 
 Source IP address is preserved Yes Yes 
 SSL offloading No Yes 
 Supported protocols TCP, UDP HTTPS, HTTP, TCP 
 Transport layer Layer 4 Layer 4, Layer 7 
 Types of load balancers Public and private Public and private 
 Virtual IP Address (VIP) Single Multiple 
 Route mode for VNFs Yes (see [Setting up high availability for Virtual Network Functions (VNF)](https://cloud.ibm.com/docs/vpc?topic=vpc-about-vnf)) No 
 Virtual Servers on VPC Yes Yes 
 Member type Virtual server instances Virtual server instances, Bare Metal, Power Systems Virtual Server 
 Power Systems Virtual Server instances connected over Direct Link No Yes (No support for instance groups) 





 High Availability mode 

The application load balancer is configured in active-active mode.
Your edge transport node virtual machines (VMs) use a private N-VDS host switch internally, and the edge nodes have their virtual network interfaces attached to vSphere distributed port groups, for example private VLAN uplinks. The edge transport nodes' private uplinks must be attached to a trunked-distributed port group, which allow the new VLAN ID to pass through. You can specify or limit the allowed VLANs on this trunked port group, if needed.
5. Workload T0 gateway's (hosted on the edge nodes) private uplinks are attached to the IBM Cloud private network. The default private VLAN uplinks are attached to an untagged VLAN segment (VLAN 0). When you configure T0 gateway for the new uplink, you must create a new VLAN backed NSX-T segment for the uplink that matches its VLAN ID (for example VLAN 3333) and use that in the uplink configuration.
6. In addition to the private side, your edge transport nodes VMs also use a public N-VDS host switch, which has a nontrunk-distributed port group to an untagged VLAN (VLAN 0) providing access only to this untagged VLAN by default. This detail is important if you need new public VLANs.
7. Workload T0 gateway is attached to IBM Cloud public network with its public uplink. Your primary public VLAN uplinks are attached to an untagged VLAN segment (VLAN 0), and a matching VLAN backed segment (for the default setup, VLAN 0 is used) is created for the public uplinks.







 Considerations 

When you design or deploy this architecture pattern, consider the following steps:



* Refer to the specific third-party vendor hardware and software specifications for interoperability with VMware® ESXi™ and NSX-T™.
* You must provide licensing (BYOL) for the third-party router or firewall solution. Contact your vendor for details.







 Related links
With NSX-T v3.x on vSphere VDS switch version 7.0, N-VDS are no longer required on the ESXi hosts. When configured as transport nodes, you can use the v7 VDS, which makes the consolidated cluster a more optimal design.

After initial deployment, the IBM Cloud® automation deploys three NSX-T Manager virtual appliances within the management cluster. The controllers are assigned a VLAN–backed IP address from the Private A portable subnet that is designated for management components. Additionally, VM–VM anti–affinity rules are created such that controllers are separated among the hosts in the cluster.

You must deploy the management cluster with a minimum of three nodes to ensure high availability for the managers or controllers. In addition to the managers, the IBM Cloud automation prepares the deployed workload cluster as NSX-T transport nodes. The ESXi transport nodes are assigned a VLAN–backed IP address from the Private A portable IP address range that is specified by an NSX IP pool ranged derived from the VLAN and subnet summary. Transport node traffic resides on the untagged VLAN and is assigned to the private NSX-T VDS.

Depending on the NSX-T topology that you choose to deploy, this design allows you to deploy an NSX-T gateway cluster either as a pair of VMs or as software deployed on bare metal cluster nodes. Bare metal edges are not supported by the IBM Cloud automation and must be manually deployed and configured. Regardless of whether the cluster pair is virtual or physical, uplinks are configured to VDS switches for both IBM Cloud private and (if present) public networks.

The following table summarizes the requirements for a medium size environment, which is the recommended starting size for production workloads.



Table 4. NSX-T component specification

 Resources Manager x3 Edge services <br>cluster x4 

 Medium size Virtual appliance Virtual appliance 
 Number of vCPUs 6 4 
 Memory 24 GB 8 GB 
 Disk 300 GB vSAN or management NFS 200 GB vSAN or management NFS 
 Disk type Thin provisioned Thin provisioned 
 Network Private A Private A 







 Distributed switch design 

The design uses a minimum number of VDS switches.
Layer 7 Backend servers to be added
l7Members = [
{
'address': '10.131.11.46',
'port': 80,
'weight': 10
},
{
'address': '10.130.188.130',
'port': 81,
'weight': 11
}
]

 Layer 7 Health monitor to be added
l7HealthMonitor = {
'interval': 10,
'timeout': 5,
'maxRetries': 3,
'urlPath': '/'
}

 Layer 7 session affinity to be added. Only supports SOURCE_IP as of now
l7SessionAffinity = {
'type': 'SOURCE_IP'
}

client = SoftLayer.Client()
networkLBaaSL7PoolService = client['SoftLayer_Network_LBaaS_L7Pool']

try:
result = networkLBaaSL7PoolService.createL7Pool(loadBalancerUuid, l7Pool, l7Members,
l7HealthMonitor, l7SessionAffinity)
pprint(result)
except SoftLayer.SoftLayerAPIError as e:
print("Unable to create a Layer 7 Pool with servers: %s, %s"
% (e.faultCode, e.faultString))
Show more





 Update a Layer 7 pool along with health monitoring and session affinity 

import SoftLayer
from pprint import pprint

 UUID of L7 pool to be updated
l7PoolUuid = 'set me'

 New Layer 7 pool values to be updated
l7Pool = {'loadBalancingAlgorithm': 'LEASTCONNECTION'}

 New Layer 7 Health monitor values to be updated
l7HealthMonitor = {'urlPath': '/index'}

 New Layer 7 session affinity values to be updated.
 If not given it deletes the existing session affinity
Deploy isolated workloads across multiple locations and zones 

This tutorial may incur costs. Use the [Cost Estimator](https://cloud.ibm.com/estimator/review) to generate a cost estimate based on your projected usage.

This tutorial walks you through steps for setting up highly available and isolated workloads by provisioning IBM Cloud® Virtual Private Clouds (VPCs). You will create virtual server instances (VSIs) in multiple zones within one region to ensure the high availability of the application. You will create additional VSIs in a second region and configure a global load balancer (GLB) to provide high availability between regions and reduce network latency for users in different geographies.

You will provision an IBM Cloud Internet Services (CIS) service as the GLB from the catalog, and an IBM Cloud Secrets Manager service from the catalog to manage the Transport Layer Security (TLS) certificate for all incoming HTTPS requests.



 Objectives 



* Understand the isolation of workloads through infrastructure objects available for virtual private clouds.
* Use a load balancer between zones within a region to distribute traffic among virtual servers.
* Use a global load balancer between regions to implement high availability, increase resiliency and reduce latency.



Zoom

![Architecture](https://cloud.ibm.com/docs-content/v1/content/f84e2238288b7f0355715a4c355609ce7ac48fb0/solution-tutorials/images/solution41-vpc-multi-region/vpc-multi-region-architecture.svg)

Figure 1. Architecture diagram of the tutorial



1. The admin (DevOps) provisions VSIs in subnets under two different zones in a VPC in region 1 and repeats the same in a VPC created in region 2.
2. The admin creates a load balancer with a backend pool of servers in different zones of region 1 and a frontend listener. Repeats the same in region 2.
3. The admin provisions a IBM Cloud Internet Services instance with an associated custom domain and creates a global load balancer pointing to the load balancers created in two different VPCs.
Condition Type of evaluation 

 contains Verify whether the value extracted based on the type contains the string that is specified in the value. 
 equals Verify whether the value extracted based on the type is identical to the string specified in the value. 
 matches_regex Match the value extracted based on the type with the regular expression that is specified in the value. 







 Rule properties 

Table 4 describes layer 7 policy rule properties.



Table 4. Descriptions of rule properties

 Property Description 

 type Specifies the type of rule. The acceptable values are hostname, header, path, query, or body. 
 condition Specifies the condition with which a rule is evaluated. Condition can be: contains, equals, or matches_regex. 
 field Specifies the field name. This field is applicable only to the headerquery and body rule type and does not support regular expression and wildcard characters. For example, to match a cookie in the HTTP header, the field can be set to cookie. When the rule type is query and body, this field is optional. 
 value The string to be matched. Does not support wildcard characters. Supports regular expression if the condition is set to matches_regex. 



Notes:



* If the rule type is header, the following characters are not allowed for field and value: "(),/:;<=>?@[ ! ! ! ! ]{}'. * If the rule type is body, the following characters are not allowed for field and value: "'=,()& and space.
If your app needs to listen on a port other than port 8080, either deploy your app from the console and specify the correct port or use the --port option on the app create command. For more information about environment variables that are set by Code Engine, see [Automatically injected environment variables](https://cloud.ibm.com/docs/codeengine?topic=codeengine-inside-env-vars). The following ports are reserved by Code Engine: 8022, 8008, 8012, 9090, 9091, and 15090. Only one port can be exposed as the listening port.





 Considerations for HTTP handling 

When you are working with applications (or jobs), it is helpful to be aware of basic HTTP handling in Code Engine.



* For incoming application connections that use HTTP, the transport layer security (TLS) aspects are managed automatically by Code Engine outside of the application code. The HTTP server for the application needs to be concerned about only HTTP connectivity and not HTTPS connectivity.
* Internet connections that are bound for Code Engine applications are automatically redirected to use HTTPS.
* Outbound connections from applications to other Code Engine applications are automatically protected by TLS. Code Engine automatically manages this connectivity, so the protocol (or URL) that is used is HTTP and not HTTPS.
* Outbound connections from applications to non-Code Engine applications, such as the internet, use HTTP or HTTPS depending on the protocol that is specified in the app code or URL.
* Outbound connections from batch jobs use the HTTP or HTTPS protocol that is specified in the job code or URL. This behavior includes connections from batch jobs to Code Engine apps.







 Options for visibility for a Code Engine application 

With Code Engine, you can determine the right level of visibility for your application by defining the endpoints, or system domain mappings, that are available for receiving requests.

Every application has an internal system domain mapping that is visible to all components within the same Code Engine project, but not outside of the project. In addition to the internal system domain mapping, you choose to make the application visible to either the public internet or the IBM Cloud private network.

You can deploy your application with the following visibility levels:



Table 1. Visibility for applications

 Setting Description