curl --request POST \
--url https://api.extole.io/v1/client-domain-patterns \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"client_domain_id": "client_domain_id",
"component_ids": [
"component_id"
],
"component_references": [
{
"component_id": "component_id",
"socket_names": [
"socket_name"
]
}
],
"pattern": "pattern",
"test": true,
"type": "DOMAIN"
}
'import requests
url = "https://api.extole.io/v1/client-domain-patterns"
payload = {
"client_domain_id": "client_domain_id",
"component_ids": ["component_id"],
"component_references": [
{
"component_id": "component_id",
"socket_names": ["socket_name"]
}
],
"pattern": "pattern",
"test": True,
"type": "DOMAIN"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_domain_id: 'client_domain_id',
component_ids: ['component_id'],
component_references: [{component_id: 'component_id', socket_names: ['socket_name']}],
pattern: 'pattern',
test: true,
type: 'DOMAIN'
})
};
fetch('https://api.extole.io/v1/client-domain-patterns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.extole.io/v1/client-domain-patterns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_domain_id' => 'client_domain_id',
'component_ids' => [
'component_id'
],
'component_references' => [
[
'component_id' => 'component_id',
'socket_names' => [
'socket_name'
]
]
],
'pattern' => 'pattern',
'test' => true,
'type' => 'DOMAIN'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.extole.io/v1/client-domain-patterns"
payload := strings.NewReader("{\n \"client_domain_id\": \"client_domain_id\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"pattern\": \"pattern\",\n \"test\": true,\n \"type\": \"DOMAIN\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.extole.io/v1/client-domain-patterns")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"client_domain_id\": \"client_domain_id\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"pattern\": \"pattern\",\n \"test\": true,\n \"type\": \"DOMAIN\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v1/client-domain-patterns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_domain_id\": \"client_domain_id\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"pattern\": \"pattern\",\n \"test\": true,\n \"type\": \"DOMAIN\"\n}"
response = http.request(request)
puts response.read_body{
"client_domain_id": "<string>",
"component_ids": [
"<string>"
],
"component_references": [
{
"component_id": "<string>",
"socket_names": [
"<string>"
]
}
],
"id": "<string>",
"pattern": "<string>",
"test": true,
"type": "DOMAIN"
}Create client domain pattern
Creates a new domain pattern definition and returns the persisted record with its server-assigned id. The pattern field is required. type defaults to GLOB when omitted. Set test=true to create a test-only pattern that is not used in production domain matching. The pattern must be buildable; complex BuildtimeEvaluatable expressions are evaluated at build time.
curl --request POST \
--url https://api.extole.io/v1/client-domain-patterns \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"client_domain_id": "client_domain_id",
"component_ids": [
"component_id"
],
"component_references": [
{
"component_id": "component_id",
"socket_names": [
"socket_name"
]
}
],
"pattern": "pattern",
"test": true,
"type": "DOMAIN"
}
'import requests
url = "https://api.extole.io/v1/client-domain-patterns"
payload = {
"client_domain_id": "client_domain_id",
"component_ids": ["component_id"],
"component_references": [
{
"component_id": "component_id",
"socket_names": ["socket_name"]
}
],
"pattern": "pattern",
"test": True,
"type": "DOMAIN"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_domain_id: 'client_domain_id',
component_ids: ['component_id'],
component_references: [{component_id: 'component_id', socket_names: ['socket_name']}],
pattern: 'pattern',
test: true,
type: 'DOMAIN'
})
};
fetch('https://api.extole.io/v1/client-domain-patterns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.extole.io/v1/client-domain-patterns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_domain_id' => 'client_domain_id',
'component_ids' => [
'component_id'
],
'component_references' => [
[
'component_id' => 'component_id',
'socket_names' => [
'socket_name'
]
]
],
'pattern' => 'pattern',
'test' => true,
'type' => 'DOMAIN'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.extole.io/v1/client-domain-patterns"
payload := strings.NewReader("{\n \"client_domain_id\": \"client_domain_id\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"pattern\": \"pattern\",\n \"test\": true,\n \"type\": \"DOMAIN\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.extole.io/v1/client-domain-patterns")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"client_domain_id\": \"client_domain_id\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"pattern\": \"pattern\",\n \"test\": true,\n \"type\": \"DOMAIN\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.extole.io/v1/client-domain-patterns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_domain_id\": \"client_domain_id\",\n \"component_ids\": [\n \"component_id\"\n ],\n \"component_references\": [\n {\n \"component_id\": \"component_id\",\n \"socket_names\": [\n \"socket_name\"\n ]\n }\n ],\n \"pattern\": \"pattern\",\n \"test\": true,\n \"type\": \"DOMAIN\"\n}"
response = http.request(request)
puts response.read_body{
"client_domain_id": "<string>",
"component_ids": [
"<string>"
],
"component_references": [
{
"component_id": "<string>",
"socket_names": [
"<string>"
]
}
],
"id": "<string>",
"pattern": "<string>",
"test": true,
"type": "DOMAIN"
}Body
Body of a POST /v1/client-domain-patterns request.
Choose between static or dynamic pattern. Buildtime expressions use ClientDomainPatternBuildtimeContext.
Choose between static or dynamic test. Buildtime expressions use ClientDomainPatternBuildtimeContext.
Response
Successful response
Client domain pattern source definition with build-time expressions and component references.
Build-time expression that resolves to the domain pattern used for matching. Buildtime expressions use ClientDomainPatternBuildtimeContext.
Build-time expression that marks whether the pattern is used for test traffic only. Buildtime expressions use ClientDomainPatternBuildtimeContext.
Was this page helpful?
