Service Inventory Management
POST
Create a subscription (hub) to receive Events
{{baseUrl}}/hub
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/hub");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/hub" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/hub"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/hub"),
Content = new StringContent("{}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/hub");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/hub"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/hub HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/hub")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/hub"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/hub")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/hub")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/hub');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/hub',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/hub';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/hub',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/hub")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/hub',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/hub',
headers: {'content-type': 'application/json'},
body: {},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/hub');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/hub',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/hub';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/hub"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/hub" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/hub",
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([
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/hub', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/hub');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/hub');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/hub' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/hub' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/hub", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/hub"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/hub"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/hub")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/hub') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/hub";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/hub \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/hub \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/hub
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/hub")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
Remove a subscription (hub) to receive Events
{{baseUrl}}/hub/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/hub/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/hub/:id")
require "http/client"
url = "{{baseUrl}}/hub/:id"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/hub/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/hub/:id");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/hub/:id"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/hub/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/hub/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/hub/:id"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/hub/:id")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/hub/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/hub/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/hub/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/hub/:id';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/hub/:id',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/hub/:id")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/hub/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/hub/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/hub/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/hub/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/hub/:id';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/hub/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/hub/:id" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/hub/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/hub/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/hub/:id');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/hub/:id');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/hub/:id' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/hub/:id' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/hub/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/hub/:id"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/hub/:id"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/hub/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/hub/:id') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/hub/:id";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/hub/:id
http DELETE {{baseUrl}}/hub/:id
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/hub/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/hub/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Client listener for entity ServiceAttributeValueChangeEvent
{{baseUrl}}/listener/serviceAttributeValueChangeEvent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listener/serviceAttributeValueChangeEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listener/serviceAttributeValueChangeEvent" {:content-type :json
:form-params {:correlationId "7af07271-5f0c"
:description "ServiceAttributeValueChangeEvent illustration"
:domain "Commercial"
:eventId "4414-a94c-43a0a142a98c"
:eventTime "2022-08-25T12:19:28.526Z"
:eventType "ServiceAttributeValueChangeEvent"
:priority "3"
:timeOcurred "2022-08-25T12:19:19.786Z"
:title "ServiceAttributeValueChangeEvent"
:event {:service {:href "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351"
:id "5351"
:@type "Service"
:place [{:role "InstallationAddress"
:place {:href "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435"
:id "2435"
:name "Customer primary location"
:@type "PlaceRef"
:@referredType "GeographicAddress"}
:@type "RelatedPlaceRefOrValue"}]}}
:reportingSystem {:id "427"
:name "APP-755"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:source {:id "149"
:name "APP-78"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:@baseType "Event"
:@type "ServiceAttributeValueChangeEvent"}})
require "http/client"
url = "{{baseUrl}}/listener/serviceAttributeValueChangeEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/listener/serviceAttributeValueChangeEvent"),
Content = new StringContent("{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/listener/serviceAttributeValueChangeEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listener/serviceAttributeValueChangeEvent"
payload := strings.NewReader("{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/listener/serviceAttributeValueChangeEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1314
{
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
]
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listener/serviceAttributeValueChangeEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listener/serviceAttributeValueChangeEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listener/serviceAttributeValueChangeEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listener/serviceAttributeValueChangeEvent")
.header("content-type", "application/json")
.body("{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}")
.asString();
const data = JSON.stringify({
correlationId: '7af07271-5f0c',
description: 'ServiceAttributeValueChangeEvent illustration',
domain: 'Commercial',
eventId: '4414-a94c-43a0a142a98c',
eventTime: '2022-08-25T12:19:28.526Z',
eventType: 'ServiceAttributeValueChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:19.786Z',
title: 'ServiceAttributeValueChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
]
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceAttributeValueChangeEvent'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/listener/serviceAttributeValueChangeEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceAttributeValueChangeEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: '7af07271-5f0c',
description: 'ServiceAttributeValueChangeEvent illustration',
domain: 'Commercial',
eventId: '4414-a94c-43a0a142a98c',
eventTime: '2022-08-25T12:19:28.526Z',
eventType: 'ServiceAttributeValueChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:19.786Z',
title: 'ServiceAttributeValueChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
]
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceAttributeValueChangeEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listener/serviceAttributeValueChangeEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"7af07271-5f0c","description":"ServiceAttributeValueChangeEvent illustration","domain":"Commercial","eventId":"4414-a94c-43a0a142a98c","eventTime":"2022-08-25T12:19:28.526Z","eventType":"ServiceAttributeValueChangeEvent","priority":"3","timeOcurred":"2022-08-25T12:19:19.786Z","title":"ServiceAttributeValueChangeEvent","event":{"service":{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","id":"5351","@type":"Service","place":[{"role":"InstallationAddress","place":{"href":"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435","id":"2435","name":"Customer primary location","@type":"PlaceRef","@referredType":"GeographicAddress"},"@type":"RelatedPlaceRefOrValue"}]}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceAttributeValueChangeEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/listener/serviceAttributeValueChangeEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "correlationId": "7af07271-5f0c",\n "description": "ServiceAttributeValueChangeEvent illustration",\n "domain": "Commercial",\n "eventId": "4414-a94c-43a0a142a98c",\n "eventTime": "2022-08-25T12:19:28.526Z",\n "eventType": "ServiceAttributeValueChangeEvent",\n "priority": "3",\n "timeOcurred": "2022-08-25T12:19:19.786Z",\n "title": "ServiceAttributeValueChangeEvent",\n "event": {\n "service": {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "id": "5351",\n "@type": "Service",\n "place": [\n {\n "role": "InstallationAddress",\n "place": {\n "href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",\n "id": "2435",\n "name": "Customer primary location",\n "@type": "PlaceRef",\n "@referredType": "GeographicAddress"\n },\n "@type": "RelatedPlaceRefOrValue"\n }\n ]\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceAttributeValueChangeEvent"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listener/serviceAttributeValueChangeEvent")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/listener/serviceAttributeValueChangeEvent',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
correlationId: '7af07271-5f0c',
description: 'ServiceAttributeValueChangeEvent illustration',
domain: 'Commercial',
eventId: '4414-a94c-43a0a142a98c',
eventTime: '2022-08-25T12:19:28.526Z',
eventType: 'ServiceAttributeValueChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:19.786Z',
title: 'ServiceAttributeValueChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
]
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceAttributeValueChangeEvent'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceAttributeValueChangeEvent',
headers: {'content-type': 'application/json'},
body: {
correlationId: '7af07271-5f0c',
description: 'ServiceAttributeValueChangeEvent illustration',
domain: 'Commercial',
eventId: '4414-a94c-43a0a142a98c',
eventTime: '2022-08-25T12:19:28.526Z',
eventType: 'ServiceAttributeValueChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:19.786Z',
title: 'ServiceAttributeValueChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
]
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceAttributeValueChangeEvent'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/listener/serviceAttributeValueChangeEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
correlationId: '7af07271-5f0c',
description: 'ServiceAttributeValueChangeEvent illustration',
domain: 'Commercial',
eventId: '4414-a94c-43a0a142a98c',
eventTime: '2022-08-25T12:19:28.526Z',
eventType: 'ServiceAttributeValueChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:19.786Z',
title: 'ServiceAttributeValueChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
]
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceAttributeValueChangeEvent'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceAttributeValueChangeEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: '7af07271-5f0c',
description: 'ServiceAttributeValueChangeEvent illustration',
domain: 'Commercial',
eventId: '4414-a94c-43a0a142a98c',
eventTime: '2022-08-25T12:19:28.526Z',
eventType: 'ServiceAttributeValueChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:19.786Z',
title: 'ServiceAttributeValueChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
]
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceAttributeValueChangeEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listener/serviceAttributeValueChangeEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"7af07271-5f0c","description":"ServiceAttributeValueChangeEvent illustration","domain":"Commercial","eventId":"4414-a94c-43a0a142a98c","eventTime":"2022-08-25T12:19:28.526Z","eventType":"ServiceAttributeValueChangeEvent","priority":"3","timeOcurred":"2022-08-25T12:19:19.786Z","title":"ServiceAttributeValueChangeEvent","event":{"service":{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","id":"5351","@type":"Service","place":[{"role":"InstallationAddress","place":{"href":"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435","id":"2435","name":"Customer primary location","@type":"PlaceRef","@referredType":"GeographicAddress"},"@type":"RelatedPlaceRefOrValue"}]}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceAttributeValueChangeEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"correlationId": @"7af07271-5f0c",
@"description": @"ServiceAttributeValueChangeEvent illustration",
@"domain": @"Commercial",
@"eventId": @"4414-a94c-43a0a142a98c",
@"eventTime": @"2022-08-25T12:19:28.526Z",
@"eventType": @"ServiceAttributeValueChangeEvent",
@"priority": @"3",
@"timeOcurred": @"2022-08-25T12:19:19.786Z",
@"title": @"ServiceAttributeValueChangeEvent",
@"event": @{ @"service": @{ @"href": @"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351", @"id": @"5351", @"@type": @"Service", @"place": @[ @{ @"role": @"InstallationAddress", @"place": @{ @"href": @"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435", @"id": @"2435", @"name": @"Customer primary location", @"@type": @"PlaceRef", @"@referredType": @"GeographicAddress" }, @"@type": @"RelatedPlaceRefOrValue" } ] } },
@"reportingSystem": @{ @"id": @"427", @"name": @"APP-755", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"source": @{ @"id": @"149", @"name": @"APP-78", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"@baseType": @"Event",
@"@type": @"ServiceAttributeValueChangeEvent" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listener/serviceAttributeValueChangeEvent"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/listener/serviceAttributeValueChangeEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listener/serviceAttributeValueChangeEvent",
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([
'correlationId' => '7af07271-5f0c',
'description' => 'ServiceAttributeValueChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '4414-a94c-43a0a142a98c',
'eventTime' => '2022-08-25T12:19:28.526Z',
'eventType' => 'ServiceAttributeValueChangeEvent',
'priority' => '3',
'timeOcurred' => '2022-08-25T12:19:19.786Z',
'title' => 'ServiceAttributeValueChangeEvent',
'event' => [
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'id' => '5351',
'@type' => 'Service',
'place' => [
[
'role' => 'InstallationAddress',
'place' => [
'href' => 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
'id' => '2435',
'name' => 'Customer primary location',
'@type' => 'PlaceRef',
'@referredType' => 'GeographicAddress'
],
'@type' => 'RelatedPlaceRefOrValue'
]
]
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceAttributeValueChangeEvent'
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listener/serviceAttributeValueChangeEvent', [
'body' => '{
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
]
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listener/serviceAttributeValueChangeEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'correlationId' => '7af07271-5f0c',
'description' => 'ServiceAttributeValueChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '4414-a94c-43a0a142a98c',
'eventTime' => '2022-08-25T12:19:28.526Z',
'eventType' => 'ServiceAttributeValueChangeEvent',
'priority' => '3',
'timeOcurred' => '2022-08-25T12:19:19.786Z',
'title' => 'ServiceAttributeValueChangeEvent',
'event' => [
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'id' => '5351',
'@type' => 'Service',
'place' => [
[
'role' => 'InstallationAddress',
'place' => [
'href' => 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
'id' => '2435',
'name' => 'Customer primary location',
'@type' => 'PlaceRef',
'@referredType' => 'GeographicAddress'
],
'@type' => 'RelatedPlaceRefOrValue'
]
]
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceAttributeValueChangeEvent'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'correlationId' => '7af07271-5f0c',
'description' => 'ServiceAttributeValueChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '4414-a94c-43a0a142a98c',
'eventTime' => '2022-08-25T12:19:28.526Z',
'eventType' => 'ServiceAttributeValueChangeEvent',
'priority' => '3',
'timeOcurred' => '2022-08-25T12:19:19.786Z',
'title' => 'ServiceAttributeValueChangeEvent',
'event' => [
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'id' => '5351',
'@type' => 'Service',
'place' => [
[
'role' => 'InstallationAddress',
'place' => [
'href' => 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
'id' => '2435',
'name' => 'Customer primary location',
'@type' => 'PlaceRef',
'@referredType' => 'GeographicAddress'
],
'@type' => 'RelatedPlaceRefOrValue'
]
]
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceAttributeValueChangeEvent'
]));
$request->setRequestUrl('{{baseUrl}}/listener/serviceAttributeValueChangeEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listener/serviceAttributeValueChangeEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
]
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listener/serviceAttributeValueChangeEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
]
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listener/serviceAttributeValueChangeEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listener/serviceAttributeValueChangeEvent"
payload = {
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": { "service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
]
} },
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listener/serviceAttributeValueChangeEvent"
payload <- "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listener/serviceAttributeValueChangeEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/listener/serviceAttributeValueChangeEvent') do |req|
req.body = "{\n \"correlationId\": \"7af07271-5f0c\",\n \"description\": \"ServiceAttributeValueChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4414-a94c-43a0a142a98c\",\n \"eventTime\": \"2022-08-25T12:19:28.526Z\",\n \"eventType\": \"ServiceAttributeValueChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:19.786Z\",\n \"title\": \"ServiceAttributeValueChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ]\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceAttributeValueChangeEvent\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/listener/serviceAttributeValueChangeEvent";
let payload = json!({
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": json!({"service": json!({
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": (
json!({
"role": "InstallationAddress",
"place": json!({
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
}),
"@type": "RelatedPlaceRefOrValue"
})
)
})}),
"reportingSystem": json!({
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"source": json!({
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/listener/serviceAttributeValueChangeEvent \
--header 'content-type: application/json' \
--data '{
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
]
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
}'
echo '{
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
]
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
}' | \
http POST {{baseUrl}}/listener/serviceAttributeValueChangeEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "correlationId": "7af07271-5f0c",\n "description": "ServiceAttributeValueChangeEvent illustration",\n "domain": "Commercial",\n "eventId": "4414-a94c-43a0a142a98c",\n "eventTime": "2022-08-25T12:19:28.526Z",\n "eventType": "ServiceAttributeValueChangeEvent",\n "priority": "3",\n "timeOcurred": "2022-08-25T12:19:19.786Z",\n "title": "ServiceAttributeValueChangeEvent",\n "event": {\n "service": {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "id": "5351",\n "@type": "Service",\n "place": [\n {\n "role": "InstallationAddress",\n "place": {\n "href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",\n "id": "2435",\n "name": "Customer primary location",\n "@type": "PlaceRef",\n "@referredType": "GeographicAddress"\n },\n "@type": "RelatedPlaceRefOrValue"\n }\n ]\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceAttributeValueChangeEvent"\n}' \
--output-document \
- {{baseUrl}}/listener/serviceAttributeValueChangeEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"correlationId": "7af07271-5f0c",
"description": "ServiceAttributeValueChangeEvent illustration",
"domain": "Commercial",
"eventId": "4414-a94c-43a0a142a98c",
"eventTime": "2022-08-25T12:19:28.526Z",
"eventType": "ServiceAttributeValueChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:19.786Z",
"title": "ServiceAttributeValueChangeEvent",
"event": ["service": [
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"place": [
[
"role": "InstallationAddress",
"place": [
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
],
"@type": "RelatedPlaceRefOrValue"
]
]
]],
"reportingSystem": [
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"source": [
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"@baseType": "Event",
"@type": "ServiceAttributeValueChangeEvent"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listener/serviceAttributeValueChangeEvent")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Client listener for entity ServiceCreateEvent
{{baseUrl}}/listener/serviceCreateEvent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listener/serviceCreateEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listener/serviceCreateEvent" {:content-type :json
:form-params {:correlationId "b382501b-c423"
:description "ServiceCreateEvent illustration"
:domain "Commercial"
:eventId "4da6-b0f1-5a7fce3edc94"
:eventTime "2022-08-25T12:19:28.512Z"
:eventType "ServiceCreateEvent"
:priority "4"
:timeOcurred "2022-08-25T12:19:28.180Z"
:title "ServiceCreateEvent"
:event {:service {:id "5351"
:href "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351"
:serviceType "Cloud"
:name "vCPE serial 1355615"
:description "Instantiation of vCPE"
:state "active"
:category "CFS"
:isServiceEnabled true
:hasStarted true
:startMode "1"
:isStateful true
:startDate "2018-01-15T12:26:11.747Z"
:serviceSpecification {:id "1212"
:href "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212"
:name "vCPE"
:version "1.0.0"
:@type "ServiceSpecificationRef"
:@referredType "ServiceSpecification"}
:feature [{:id "Feat1"
:isEnabled true
:name "ElasticBandwith"
:featureCharacteritic [{:name "isCapped"
:value true
:id "45gh-fg"
:valueType "boolean"
:@type "BooleanCharacteristic"}]
:@type "Feature"}]
:serviceCharacteristic [{:id "452-gh6"
:name "vCPE"
:valueType "object"
:value {:@type "VCPE"
:@schemaLocation "http://my.schemas/vCPE.schema.json"
:vCPE_IP "193.218.236.21"
:MaxTxRate 300
:TransmitPower "11 dBm"
:maxTream "OFF"}
:@type "ObjectCharacteristic"}]
:serviceRelationship [{:relationshipType "DependentOn"
:ServiceRelationshipCharacteristic [{:id "126"
:name "CrossRef"
:value "44-11-h"
:valueType "string"
:@type "StringCharacteristic"}]
:service {:href "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645"
:id "5645"
:@type "ServiceRef"
:@referredType "Service"}
:@type "ServiceRelationship"}]
:supportingService [{:href "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885"
:id "5885"
:@type "ServiceRef"
:@referredType "Service"}]
:supportingResource [{:id "6161"
:href "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351"
:name "GenInfra"
:@type "ResourceRef"
:@referredType "VirtualResource"} {:id "7171"
:href "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171"
:name "BNG_MUX"
:value "01 25 65"
:@type "ResourceRef"
:@referredType "VNF"}]
:relatedParty [{:role "user"
:partyOrPartyRole {:href "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456"
:id "456"
:name "John Doe"
:@type "PartyRef"
:@referredType "Individual"}
:@type "RelatedPartyRefOrPartyRoleRef"}]
:serviceOrderItem [{:serviceOrderHref "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42"
:serviceOrderId "42"
:role "initiator"
:@referredType "ServiceOrderItem"
:@type "RelatedServiceOrderItem"
:itemId "1"
:itemAction "add"} {:serviceOrderHref "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896"
:serviceOrderId "896"
:role "activation"
:@referredType "ServiceOrderItem"
:@type "RelatedServiceOrderItem"
:itemId "4"
:itemAction "modify"}]
:place [{:role "InstallationAddress"
:place {:href "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435"
:id "2435"
:name "Customer primary location"
:@type "PlaceRef"
:@referredType "GeographicAddress"}
:@type "RelatedPlaceRefOrValue"}]
:note [{:id "77456"
:author "Harvey Poupon"
:date "2018-01-15T12:26:11.748Z"
:text "This service was installed automatically, no issues were noted in testing."
:@type "Note"}]
:@type "Service"}}
:reportingSystem {:id "427"
:name "APP-755"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:source {:id "149"
:name "APP-78"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:@baseType "Event"
:@type "ServiceCreateEvent"}})
require "http/client"
url = "{{baseUrl}}/listener/serviceCreateEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/listener/serviceCreateEvent"),
Content = new StringContent("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/listener/serviceCreateEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listener/serviceCreateEvent"
payload := strings.NewReader("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/listener/serviceCreateEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 5577
{
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"supportingResource": [
{
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
},
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
},
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceCreateEvent"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listener/serviceCreateEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listener/serviceCreateEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listener/serviceCreateEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listener/serviceCreateEvent")
.header("content-type", "application/json")
.body("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}")
.asString();
const data = JSON.stringify({
correlationId: 'b382501b-c423',
description: 'ServiceCreateEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceCreateEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceCreateEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
serviceType: 'Cloud',
name: 'vCPE serial 1355615',
description: 'Instantiation of vCPE',
state: 'active',
category: 'CFS',
isServiceEnabled: true,
hasStarted: true,
startMode: '1',
isStateful: true,
startDate: '2018-01-15T12:26:11.747Z',
serviceSpecification: {
id: '1212',
href: 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
name: 'vCPE',
version: '1.0.0',
'@type': 'ServiceSpecificationRef',
'@referredType': 'ServiceSpecification'
},
feature: [
{
id: 'Feat1',
isEnabled: true,
name: 'ElasticBandwith',
featureCharacteritic: [
{
name: 'isCapped',
value: true,
id: '45gh-fg',
valueType: 'boolean',
'@type': 'BooleanCharacteristic'
}
],
'@type': 'Feature'
}
],
serviceCharacteristic: [
{
id: '452-gh6',
name: 'vCPE',
valueType: 'object',
value: {
'@type': 'VCPE',
'@schemaLocation': 'http://my.schemas/vCPE.schema.json',
vCPE_IP: '193.218.236.21',
MaxTxRate: 300,
TransmitPower: '11 dBm',
maxTream: 'OFF'
},
'@type': 'ObjectCharacteristic'
}
],
serviceRelationship: [
{
relationshipType: 'DependentOn',
ServiceRelationshipCharacteristic: [
{
id: '126',
name: 'CrossRef',
value: '44-11-h',
valueType: 'string',
'@type': 'StringCharacteristic'
}
],
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
id: '5645',
'@type': 'ServiceRef',
'@referredType': 'Service'
},
'@type': 'ServiceRelationship'
}
],
supportingService: [
{
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
id: '5885',
'@type': 'ServiceRef',
'@referredType': 'Service'
}
],
supportingResource: [
{
id: '6161',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
name: 'GenInfra',
'@type': 'ResourceRef',
'@referredType': 'VirtualResource'
},
{
id: '7171',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
name: 'BNG_MUX',
value: '01 25 65',
'@type': 'ResourceRef',
'@referredType': 'VNF'
}
],
relatedParty: [
{
role: 'user',
partyOrPartyRole: {
href: 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
id: '456',
name: 'John Doe',
'@type': 'PartyRef',
'@referredType': 'Individual'
},
'@type': 'RelatedPartyRefOrPartyRoleRef'
}
],
serviceOrderItem: [
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
serviceOrderId: '42',
role: 'initiator',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '1',
itemAction: 'add'
},
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
serviceOrderId: '896',
role: 'activation',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '4',
itemAction: 'modify'
}
],
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
],
note: [
{
id: '77456',
author: 'Harvey Poupon',
date: '2018-01-15T12:26:11.748Z',
text: 'This service was installed automatically, no issues were noted in testing.',
'@type': 'Note'
}
],
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceCreateEvent'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/listener/serviceCreateEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceCreateEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: 'b382501b-c423',
description: 'ServiceCreateEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceCreateEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceCreateEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
serviceType: 'Cloud',
name: 'vCPE serial 1355615',
description: 'Instantiation of vCPE',
state: 'active',
category: 'CFS',
isServiceEnabled: true,
hasStarted: true,
startMode: '1',
isStateful: true,
startDate: '2018-01-15T12:26:11.747Z',
serviceSpecification: {
id: '1212',
href: 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
name: 'vCPE',
version: '1.0.0',
'@type': 'ServiceSpecificationRef',
'@referredType': 'ServiceSpecification'
},
feature: [
{
id: 'Feat1',
isEnabled: true,
name: 'ElasticBandwith',
featureCharacteritic: [
{
name: 'isCapped',
value: true,
id: '45gh-fg',
valueType: 'boolean',
'@type': 'BooleanCharacteristic'
}
],
'@type': 'Feature'
}
],
serviceCharacteristic: [
{
id: '452-gh6',
name: 'vCPE',
valueType: 'object',
value: {
'@type': 'VCPE',
'@schemaLocation': 'http://my.schemas/vCPE.schema.json',
vCPE_IP: '193.218.236.21',
MaxTxRate: 300,
TransmitPower: '11 dBm',
maxTream: 'OFF'
},
'@type': 'ObjectCharacteristic'
}
],
serviceRelationship: [
{
relationshipType: 'DependentOn',
ServiceRelationshipCharacteristic: [
{
id: '126',
name: 'CrossRef',
value: '44-11-h',
valueType: 'string',
'@type': 'StringCharacteristic'
}
],
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
id: '5645',
'@type': 'ServiceRef',
'@referredType': 'Service'
},
'@type': 'ServiceRelationship'
}
],
supportingService: [
{
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
id: '5885',
'@type': 'ServiceRef',
'@referredType': 'Service'
}
],
supportingResource: [
{
id: '6161',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
name: 'GenInfra',
'@type': 'ResourceRef',
'@referredType': 'VirtualResource'
},
{
id: '7171',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
name: 'BNG_MUX',
value: '01 25 65',
'@type': 'ResourceRef',
'@referredType': 'VNF'
}
],
relatedParty: [
{
role: 'user',
partyOrPartyRole: {
href: 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
id: '456',
name: 'John Doe',
'@type': 'PartyRef',
'@referredType': 'Individual'
},
'@type': 'RelatedPartyRefOrPartyRoleRef'
}
],
serviceOrderItem: [
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
serviceOrderId: '42',
role: 'initiator',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '1',
itemAction: 'add'
},
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
serviceOrderId: '896',
role: 'activation',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '4',
itemAction: 'modify'
}
],
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
],
note: [
{
id: '77456',
author: 'Harvey Poupon',
date: '2018-01-15T12:26:11.748Z',
text: 'This service was installed automatically, no issues were noted in testing.',
'@type': 'Note'
}
],
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceCreateEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listener/serviceCreateEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"b382501b-c423","description":"ServiceCreateEvent illustration","domain":"Commercial","eventId":"4da6-b0f1-5a7fce3edc94","eventTime":"2022-08-25T12:19:28.512Z","eventType":"ServiceCreateEvent","priority":"4","timeOcurred":"2022-08-25T12:19:28.180Z","title":"ServiceCreateEvent","event":{"service":{"id":"5351","href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","serviceType":"Cloud","name":"vCPE serial 1355615","description":"Instantiation of vCPE","state":"active","category":"CFS","isServiceEnabled":true,"hasStarted":true,"startMode":"1","isStateful":true,"startDate":"2018-01-15T12:26:11.747Z","serviceSpecification":{"id":"1212","href":"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212","name":"vCPE","version":"1.0.0","@type":"ServiceSpecificationRef","@referredType":"ServiceSpecification"},"feature":[{"id":"Feat1","isEnabled":true,"name":"ElasticBandwith","featureCharacteritic":[{"name":"isCapped","value":true,"id":"45gh-fg","valueType":"boolean","@type":"BooleanCharacteristic"}],"@type":"Feature"}],"serviceCharacteristic":[{"id":"452-gh6","name":"vCPE","valueType":"object","value":{"@type":"VCPE","@schemaLocation":"http://my.schemas/vCPE.schema.json","vCPE_IP":"193.218.236.21","MaxTxRate":300,"TransmitPower":"11 dBm","maxTream":"OFF"},"@type":"ObjectCharacteristic"}],"serviceRelationship":[{"relationshipType":"DependentOn","ServiceRelationshipCharacteristic":[{"id":"126","name":"CrossRef","value":"44-11-h","valueType":"string","@type":"StringCharacteristic"}],"service":{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645","id":"5645","@type":"ServiceRef","@referredType":"Service"},"@type":"ServiceRelationship"}],"supportingService":[{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885","id":"5885","@type":"ServiceRef","@referredType":"Service"}],"supportingResource":[{"id":"6161","href":"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351","name":"GenInfra","@type":"ResourceRef","@referredType":"VirtualResource"},{"id":"7171","href":"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171","name":"BNG_MUX","value":"01 25 65","@type":"ResourceRef","@referredType":"VNF"}],"relatedParty":[{"role":"user","partyOrPartyRole":{"href":"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456","id":"456","name":"John Doe","@type":"PartyRef","@referredType":"Individual"},"@type":"RelatedPartyRefOrPartyRoleRef"}],"serviceOrderItem":[{"serviceOrderHref":"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42","serviceOrderId":"42","role":"initiator","@referredType":"ServiceOrderItem","@type":"RelatedServiceOrderItem","itemId":"1","itemAction":"add"},{"serviceOrderHref":"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896","serviceOrderId":"896","role":"activation","@referredType":"ServiceOrderItem","@type":"RelatedServiceOrderItem","itemId":"4","itemAction":"modify"}],"place":[{"role":"InstallationAddress","place":{"href":"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435","id":"2435","name":"Customer primary location","@type":"PlaceRef","@referredType":"GeographicAddress"},"@type":"RelatedPlaceRefOrValue"}],"note":[{"id":"77456","author":"Harvey Poupon","date":"2018-01-15T12:26:11.748Z","text":"This service was installed automatically, no issues were noted in testing.","@type":"Note"}],"@type":"Service"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceCreateEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/listener/serviceCreateEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "correlationId": "b382501b-c423",\n "description": "ServiceCreateEvent illustration",\n "domain": "Commercial",\n "eventId": "4da6-b0f1-5a7fce3edc94",\n "eventTime": "2022-08-25T12:19:28.512Z",\n "eventType": "ServiceCreateEvent",\n "priority": "4",\n "timeOcurred": "2022-08-25T12:19:28.180Z",\n "title": "ServiceCreateEvent",\n "event": {\n "service": {\n "id": "5351",\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "serviceType": "Cloud",\n "name": "vCPE serial 1355615",\n "description": "Instantiation of vCPE",\n "state": "active",\n "category": "CFS",\n "isServiceEnabled": true,\n "hasStarted": true,\n "startMode": "1",\n "isStateful": true,\n "startDate": "2018-01-15T12:26:11.747Z",\n "serviceSpecification": {\n "id": "1212",\n "href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",\n "name": "vCPE",\n "version": "1.0.0",\n "@type": "ServiceSpecificationRef",\n "@referredType": "ServiceSpecification"\n },\n "feature": [\n {\n "id": "Feat1",\n "isEnabled": true,\n "name": "ElasticBandwith",\n "featureCharacteritic": [\n {\n "name": "isCapped",\n "value": true,\n "id": "45gh-fg",\n "valueType": "boolean",\n "@type": "BooleanCharacteristic"\n }\n ],\n "@type": "Feature"\n }\n ],\n "serviceCharacteristic": [\n {\n "id": "452-gh6",\n "name": "vCPE",\n "valueType": "object",\n "value": {\n "@type": "VCPE",\n "@schemaLocation": "http://my.schemas/vCPE.schema.json",\n "vCPE_IP": "193.218.236.21",\n "MaxTxRate": 300,\n "TransmitPower": "11 dBm",\n "maxTream": "OFF"\n },\n "@type": "ObjectCharacteristic"\n }\n ],\n "serviceRelationship": [\n {\n "relationshipType": "DependentOn",\n "ServiceRelationshipCharacteristic": [\n {\n "id": "126",\n "name": "CrossRef",\n "value": "44-11-h",\n "valueType": "string",\n "@type": "StringCharacteristic"\n }\n ],\n "service": {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",\n "id": "5645",\n "@type": "ServiceRef",\n "@referredType": "Service"\n },\n "@type": "ServiceRelationship"\n }\n ],\n "supportingService": [\n {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",\n "id": "5885",\n "@type": "ServiceRef",\n "@referredType": "Service"\n }\n ],\n "supportingResource": [\n {\n "id": "6161",\n "href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",\n "name": "GenInfra",\n "@type": "ResourceRef",\n "@referredType": "VirtualResource"\n },\n {\n "id": "7171",\n "href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",\n "name": "BNG_MUX",\n "value": "01 25 65",\n "@type": "ResourceRef",\n "@referredType": "VNF"\n }\n ],\n "relatedParty": [\n {\n "role": "user",\n "partyOrPartyRole": {\n "href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",\n "id": "456",\n "name": "John Doe",\n "@type": "PartyRef",\n "@referredType": "Individual"\n },\n "@type": "RelatedPartyRefOrPartyRoleRef"\n }\n ],\n "serviceOrderItem": [\n {\n "serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",\n "serviceOrderId": "42",\n "role": "initiator",\n "@referredType": "ServiceOrderItem",\n "@type": "RelatedServiceOrderItem",\n "itemId": "1",\n "itemAction": "add"\n },\n {\n "serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",\n "serviceOrderId": "896",\n "role": "activation",\n "@referredType": "ServiceOrderItem",\n "@type": "RelatedServiceOrderItem",\n "itemId": "4",\n "itemAction": "modify"\n }\n ],\n "place": [\n {\n "role": "InstallationAddress",\n "place": {\n "href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",\n "id": "2435",\n "name": "Customer primary location",\n "@type": "PlaceRef",\n "@referredType": "GeographicAddress"\n },\n "@type": "RelatedPlaceRefOrValue"\n }\n ],\n "note": [\n {\n "id": "77456",\n "author": "Harvey Poupon",\n "date": "2018-01-15T12:26:11.748Z",\n "text": "This service was installed automatically, no issues were noted in testing.",\n "@type": "Note"\n }\n ],\n "@type": "Service"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceCreateEvent"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listener/serviceCreateEvent")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/listener/serviceCreateEvent',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
correlationId: 'b382501b-c423',
description: 'ServiceCreateEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceCreateEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceCreateEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
serviceType: 'Cloud',
name: 'vCPE serial 1355615',
description: 'Instantiation of vCPE',
state: 'active',
category: 'CFS',
isServiceEnabled: true,
hasStarted: true,
startMode: '1',
isStateful: true,
startDate: '2018-01-15T12:26:11.747Z',
serviceSpecification: {
id: '1212',
href: 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
name: 'vCPE',
version: '1.0.0',
'@type': 'ServiceSpecificationRef',
'@referredType': 'ServiceSpecification'
},
feature: [
{
id: 'Feat1',
isEnabled: true,
name: 'ElasticBandwith',
featureCharacteritic: [
{
name: 'isCapped',
value: true,
id: '45gh-fg',
valueType: 'boolean',
'@type': 'BooleanCharacteristic'
}
],
'@type': 'Feature'
}
],
serviceCharacteristic: [
{
id: '452-gh6',
name: 'vCPE',
valueType: 'object',
value: {
'@type': 'VCPE',
'@schemaLocation': 'http://my.schemas/vCPE.schema.json',
vCPE_IP: '193.218.236.21',
MaxTxRate: 300,
TransmitPower: '11 dBm',
maxTream: 'OFF'
},
'@type': 'ObjectCharacteristic'
}
],
serviceRelationship: [
{
relationshipType: 'DependentOn',
ServiceRelationshipCharacteristic: [
{
id: '126',
name: 'CrossRef',
value: '44-11-h',
valueType: 'string',
'@type': 'StringCharacteristic'
}
],
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
id: '5645',
'@type': 'ServiceRef',
'@referredType': 'Service'
},
'@type': 'ServiceRelationship'
}
],
supportingService: [
{
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
id: '5885',
'@type': 'ServiceRef',
'@referredType': 'Service'
}
],
supportingResource: [
{
id: '6161',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
name: 'GenInfra',
'@type': 'ResourceRef',
'@referredType': 'VirtualResource'
},
{
id: '7171',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
name: 'BNG_MUX',
value: '01 25 65',
'@type': 'ResourceRef',
'@referredType': 'VNF'
}
],
relatedParty: [
{
role: 'user',
partyOrPartyRole: {
href: 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
id: '456',
name: 'John Doe',
'@type': 'PartyRef',
'@referredType': 'Individual'
},
'@type': 'RelatedPartyRefOrPartyRoleRef'
}
],
serviceOrderItem: [
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
serviceOrderId: '42',
role: 'initiator',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '1',
itemAction: 'add'
},
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
serviceOrderId: '896',
role: 'activation',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '4',
itemAction: 'modify'
}
],
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
],
note: [
{
id: '77456',
author: 'Harvey Poupon',
date: '2018-01-15T12:26:11.748Z',
text: 'This service was installed automatically, no issues were noted in testing.',
'@type': 'Note'
}
],
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceCreateEvent'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceCreateEvent',
headers: {'content-type': 'application/json'},
body: {
correlationId: 'b382501b-c423',
description: 'ServiceCreateEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceCreateEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceCreateEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
serviceType: 'Cloud',
name: 'vCPE serial 1355615',
description: 'Instantiation of vCPE',
state: 'active',
category: 'CFS',
isServiceEnabled: true,
hasStarted: true,
startMode: '1',
isStateful: true,
startDate: '2018-01-15T12:26:11.747Z',
serviceSpecification: {
id: '1212',
href: 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
name: 'vCPE',
version: '1.0.0',
'@type': 'ServiceSpecificationRef',
'@referredType': 'ServiceSpecification'
},
feature: [
{
id: 'Feat1',
isEnabled: true,
name: 'ElasticBandwith',
featureCharacteritic: [
{
name: 'isCapped',
value: true,
id: '45gh-fg',
valueType: 'boolean',
'@type': 'BooleanCharacteristic'
}
],
'@type': 'Feature'
}
],
serviceCharacteristic: [
{
id: '452-gh6',
name: 'vCPE',
valueType: 'object',
value: {
'@type': 'VCPE',
'@schemaLocation': 'http://my.schemas/vCPE.schema.json',
vCPE_IP: '193.218.236.21',
MaxTxRate: 300,
TransmitPower: '11 dBm',
maxTream: 'OFF'
},
'@type': 'ObjectCharacteristic'
}
],
serviceRelationship: [
{
relationshipType: 'DependentOn',
ServiceRelationshipCharacteristic: [
{
id: '126',
name: 'CrossRef',
value: '44-11-h',
valueType: 'string',
'@type': 'StringCharacteristic'
}
],
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
id: '5645',
'@type': 'ServiceRef',
'@referredType': 'Service'
},
'@type': 'ServiceRelationship'
}
],
supportingService: [
{
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
id: '5885',
'@type': 'ServiceRef',
'@referredType': 'Service'
}
],
supportingResource: [
{
id: '6161',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
name: 'GenInfra',
'@type': 'ResourceRef',
'@referredType': 'VirtualResource'
},
{
id: '7171',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
name: 'BNG_MUX',
value: '01 25 65',
'@type': 'ResourceRef',
'@referredType': 'VNF'
}
],
relatedParty: [
{
role: 'user',
partyOrPartyRole: {
href: 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
id: '456',
name: 'John Doe',
'@type': 'PartyRef',
'@referredType': 'Individual'
},
'@type': 'RelatedPartyRefOrPartyRoleRef'
}
],
serviceOrderItem: [
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
serviceOrderId: '42',
role: 'initiator',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '1',
itemAction: 'add'
},
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
serviceOrderId: '896',
role: 'activation',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '4',
itemAction: 'modify'
}
],
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
],
note: [
{
id: '77456',
author: 'Harvey Poupon',
date: '2018-01-15T12:26:11.748Z',
text: 'This service was installed automatically, no issues were noted in testing.',
'@type': 'Note'
}
],
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceCreateEvent'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/listener/serviceCreateEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
correlationId: 'b382501b-c423',
description: 'ServiceCreateEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceCreateEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceCreateEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
serviceType: 'Cloud',
name: 'vCPE serial 1355615',
description: 'Instantiation of vCPE',
state: 'active',
category: 'CFS',
isServiceEnabled: true,
hasStarted: true,
startMode: '1',
isStateful: true,
startDate: '2018-01-15T12:26:11.747Z',
serviceSpecification: {
id: '1212',
href: 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
name: 'vCPE',
version: '1.0.0',
'@type': 'ServiceSpecificationRef',
'@referredType': 'ServiceSpecification'
},
feature: [
{
id: 'Feat1',
isEnabled: true,
name: 'ElasticBandwith',
featureCharacteritic: [
{
name: 'isCapped',
value: true,
id: '45gh-fg',
valueType: 'boolean',
'@type': 'BooleanCharacteristic'
}
],
'@type': 'Feature'
}
],
serviceCharacteristic: [
{
id: '452-gh6',
name: 'vCPE',
valueType: 'object',
value: {
'@type': 'VCPE',
'@schemaLocation': 'http://my.schemas/vCPE.schema.json',
vCPE_IP: '193.218.236.21',
MaxTxRate: 300,
TransmitPower: '11 dBm',
maxTream: 'OFF'
},
'@type': 'ObjectCharacteristic'
}
],
serviceRelationship: [
{
relationshipType: 'DependentOn',
ServiceRelationshipCharacteristic: [
{
id: '126',
name: 'CrossRef',
value: '44-11-h',
valueType: 'string',
'@type': 'StringCharacteristic'
}
],
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
id: '5645',
'@type': 'ServiceRef',
'@referredType': 'Service'
},
'@type': 'ServiceRelationship'
}
],
supportingService: [
{
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
id: '5885',
'@type': 'ServiceRef',
'@referredType': 'Service'
}
],
supportingResource: [
{
id: '6161',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
name: 'GenInfra',
'@type': 'ResourceRef',
'@referredType': 'VirtualResource'
},
{
id: '7171',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
name: 'BNG_MUX',
value: '01 25 65',
'@type': 'ResourceRef',
'@referredType': 'VNF'
}
],
relatedParty: [
{
role: 'user',
partyOrPartyRole: {
href: 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
id: '456',
name: 'John Doe',
'@type': 'PartyRef',
'@referredType': 'Individual'
},
'@type': 'RelatedPartyRefOrPartyRoleRef'
}
],
serviceOrderItem: [
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
serviceOrderId: '42',
role: 'initiator',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '1',
itemAction: 'add'
},
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
serviceOrderId: '896',
role: 'activation',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '4',
itemAction: 'modify'
}
],
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
],
note: [
{
id: '77456',
author: 'Harvey Poupon',
date: '2018-01-15T12:26:11.748Z',
text: 'This service was installed automatically, no issues were noted in testing.',
'@type': 'Note'
}
],
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceCreateEvent'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceCreateEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: 'b382501b-c423',
description: 'ServiceCreateEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceCreateEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceCreateEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
serviceType: 'Cloud',
name: 'vCPE serial 1355615',
description: 'Instantiation of vCPE',
state: 'active',
category: 'CFS',
isServiceEnabled: true,
hasStarted: true,
startMode: '1',
isStateful: true,
startDate: '2018-01-15T12:26:11.747Z',
serviceSpecification: {
id: '1212',
href: 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
name: 'vCPE',
version: '1.0.0',
'@type': 'ServiceSpecificationRef',
'@referredType': 'ServiceSpecification'
},
feature: [
{
id: 'Feat1',
isEnabled: true,
name: 'ElasticBandwith',
featureCharacteritic: [
{
name: 'isCapped',
value: true,
id: '45gh-fg',
valueType: 'boolean',
'@type': 'BooleanCharacteristic'
}
],
'@type': 'Feature'
}
],
serviceCharacteristic: [
{
id: '452-gh6',
name: 'vCPE',
valueType: 'object',
value: {
'@type': 'VCPE',
'@schemaLocation': 'http://my.schemas/vCPE.schema.json',
vCPE_IP: '193.218.236.21',
MaxTxRate: 300,
TransmitPower: '11 dBm',
maxTream: 'OFF'
},
'@type': 'ObjectCharacteristic'
}
],
serviceRelationship: [
{
relationshipType: 'DependentOn',
ServiceRelationshipCharacteristic: [
{
id: '126',
name: 'CrossRef',
value: '44-11-h',
valueType: 'string',
'@type': 'StringCharacteristic'
}
],
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
id: '5645',
'@type': 'ServiceRef',
'@referredType': 'Service'
},
'@type': 'ServiceRelationship'
}
],
supportingService: [
{
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
id: '5885',
'@type': 'ServiceRef',
'@referredType': 'Service'
}
],
supportingResource: [
{
id: '6161',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
name: 'GenInfra',
'@type': 'ResourceRef',
'@referredType': 'VirtualResource'
},
{
id: '7171',
href: 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
name: 'BNG_MUX',
value: '01 25 65',
'@type': 'ResourceRef',
'@referredType': 'VNF'
}
],
relatedParty: [
{
role: 'user',
partyOrPartyRole: {
href: 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
id: '456',
name: 'John Doe',
'@type': 'PartyRef',
'@referredType': 'Individual'
},
'@type': 'RelatedPartyRefOrPartyRoleRef'
}
],
serviceOrderItem: [
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
serviceOrderId: '42',
role: 'initiator',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '1',
itemAction: 'add'
},
{
serviceOrderHref: 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
serviceOrderId: '896',
role: 'activation',
'@referredType': 'ServiceOrderItem',
'@type': 'RelatedServiceOrderItem',
itemId: '4',
itemAction: 'modify'
}
],
place: [
{
role: 'InstallationAddress',
place: {
href: 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
id: '2435',
name: 'Customer primary location',
'@type': 'PlaceRef',
'@referredType': 'GeographicAddress'
},
'@type': 'RelatedPlaceRefOrValue'
}
],
note: [
{
id: '77456',
author: 'Harvey Poupon',
date: '2018-01-15T12:26:11.748Z',
text: 'This service was installed automatically, no issues were noted in testing.',
'@type': 'Note'
}
],
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceCreateEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listener/serviceCreateEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"b382501b-c423","description":"ServiceCreateEvent illustration","domain":"Commercial","eventId":"4da6-b0f1-5a7fce3edc94","eventTime":"2022-08-25T12:19:28.512Z","eventType":"ServiceCreateEvent","priority":"4","timeOcurred":"2022-08-25T12:19:28.180Z","title":"ServiceCreateEvent","event":{"service":{"id":"5351","href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","serviceType":"Cloud","name":"vCPE serial 1355615","description":"Instantiation of vCPE","state":"active","category":"CFS","isServiceEnabled":true,"hasStarted":true,"startMode":"1","isStateful":true,"startDate":"2018-01-15T12:26:11.747Z","serviceSpecification":{"id":"1212","href":"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212","name":"vCPE","version":"1.0.0","@type":"ServiceSpecificationRef","@referredType":"ServiceSpecification"},"feature":[{"id":"Feat1","isEnabled":true,"name":"ElasticBandwith","featureCharacteritic":[{"name":"isCapped","value":true,"id":"45gh-fg","valueType":"boolean","@type":"BooleanCharacteristic"}],"@type":"Feature"}],"serviceCharacteristic":[{"id":"452-gh6","name":"vCPE","valueType":"object","value":{"@type":"VCPE","@schemaLocation":"http://my.schemas/vCPE.schema.json","vCPE_IP":"193.218.236.21","MaxTxRate":300,"TransmitPower":"11 dBm","maxTream":"OFF"},"@type":"ObjectCharacteristic"}],"serviceRelationship":[{"relationshipType":"DependentOn","ServiceRelationshipCharacteristic":[{"id":"126","name":"CrossRef","value":"44-11-h","valueType":"string","@type":"StringCharacteristic"}],"service":{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645","id":"5645","@type":"ServiceRef","@referredType":"Service"},"@type":"ServiceRelationship"}],"supportingService":[{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885","id":"5885","@type":"ServiceRef","@referredType":"Service"}],"supportingResource":[{"id":"6161","href":"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351","name":"GenInfra","@type":"ResourceRef","@referredType":"VirtualResource"},{"id":"7171","href":"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171","name":"BNG_MUX","value":"01 25 65","@type":"ResourceRef","@referredType":"VNF"}],"relatedParty":[{"role":"user","partyOrPartyRole":{"href":"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456","id":"456","name":"John Doe","@type":"PartyRef","@referredType":"Individual"},"@type":"RelatedPartyRefOrPartyRoleRef"}],"serviceOrderItem":[{"serviceOrderHref":"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42","serviceOrderId":"42","role":"initiator","@referredType":"ServiceOrderItem","@type":"RelatedServiceOrderItem","itemId":"1","itemAction":"add"},{"serviceOrderHref":"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896","serviceOrderId":"896","role":"activation","@referredType":"ServiceOrderItem","@type":"RelatedServiceOrderItem","itemId":"4","itemAction":"modify"}],"place":[{"role":"InstallationAddress","place":{"href":"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435","id":"2435","name":"Customer primary location","@type":"PlaceRef","@referredType":"GeographicAddress"},"@type":"RelatedPlaceRefOrValue"}],"note":[{"id":"77456","author":"Harvey Poupon","date":"2018-01-15T12:26:11.748Z","text":"This service was installed automatically, no issues were noted in testing.","@type":"Note"}],"@type":"Service"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceCreateEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"correlationId": @"b382501b-c423",
@"description": @"ServiceCreateEvent illustration",
@"domain": @"Commercial",
@"eventId": @"4da6-b0f1-5a7fce3edc94",
@"eventTime": @"2022-08-25T12:19:28.512Z",
@"eventType": @"ServiceCreateEvent",
@"priority": @"4",
@"timeOcurred": @"2022-08-25T12:19:28.180Z",
@"title": @"ServiceCreateEvent",
@"event": @{ @"service": @{ @"id": @"5351", @"href": @"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351", @"serviceType": @"Cloud", @"name": @"vCPE serial 1355615", @"description": @"Instantiation of vCPE", @"state": @"active", @"category": @"CFS", @"isServiceEnabled": @YES, @"hasStarted": @YES, @"startMode": @"1", @"isStateful": @YES, @"startDate": @"2018-01-15T12:26:11.747Z", @"serviceSpecification": @{ @"id": @"1212", @"href": @"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212", @"name": @"vCPE", @"version": @"1.0.0", @"@type": @"ServiceSpecificationRef", @"@referredType": @"ServiceSpecification" }, @"feature": @[ @{ @"id": @"Feat1", @"isEnabled": @YES, @"name": @"ElasticBandwith", @"featureCharacteritic": @[ @{ @"name": @"isCapped", @"value": @YES, @"id": @"45gh-fg", @"valueType": @"boolean", @"@type": @"BooleanCharacteristic" } ], @"@type": @"Feature" } ], @"serviceCharacteristic": @[ @{ @"id": @"452-gh6", @"name": @"vCPE", @"valueType": @"object", @"value": @{ @"@type": @"VCPE", @"@schemaLocation": @"http://my.schemas/vCPE.schema.json", @"vCPE_IP": @"193.218.236.21", @"MaxTxRate": @300, @"TransmitPower": @"11 dBm", @"maxTream": @"OFF" }, @"@type": @"ObjectCharacteristic" } ], @"serviceRelationship": @[ @{ @"relationshipType": @"DependentOn", @"ServiceRelationshipCharacteristic": @[ @{ @"id": @"126", @"name": @"CrossRef", @"value": @"44-11-h", @"valueType": @"string", @"@type": @"StringCharacteristic" } ], @"service": @{ @"href": @"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645", @"id": @"5645", @"@type": @"ServiceRef", @"@referredType": @"Service" }, @"@type": @"ServiceRelationship" } ], @"supportingService": @[ @{ @"href": @"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885", @"id": @"5885", @"@type": @"ServiceRef", @"@referredType": @"Service" } ], @"supportingResource": @[ @{ @"id": @"6161", @"href": @"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351", @"name": @"GenInfra", @"@type": @"ResourceRef", @"@referredType": @"VirtualResource" }, @{ @"id": @"7171", @"href": @"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171", @"name": @"BNG_MUX", @"value": @"01 25 65", @"@type": @"ResourceRef", @"@referredType": @"VNF" } ], @"relatedParty": @[ @{ @"role": @"user", @"partyOrPartyRole": @{ @"href": @"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456", @"id": @"456", @"name": @"John Doe", @"@type": @"PartyRef", @"@referredType": @"Individual" }, @"@type": @"RelatedPartyRefOrPartyRoleRef" } ], @"serviceOrderItem": @[ @{ @"serviceOrderHref": @"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42", @"serviceOrderId": @"42", @"role": @"initiator", @"@referredType": @"ServiceOrderItem", @"@type": @"RelatedServiceOrderItem", @"itemId": @"1", @"itemAction": @"add" }, @{ @"serviceOrderHref": @"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896", @"serviceOrderId": @"896", @"role": @"activation", @"@referredType": @"ServiceOrderItem", @"@type": @"RelatedServiceOrderItem", @"itemId": @"4", @"itemAction": @"modify" } ], @"place": @[ @{ @"role": @"InstallationAddress", @"place": @{ @"href": @"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435", @"id": @"2435", @"name": @"Customer primary location", @"@type": @"PlaceRef", @"@referredType": @"GeographicAddress" }, @"@type": @"RelatedPlaceRefOrValue" } ], @"note": @[ @{ @"id": @"77456", @"author": @"Harvey Poupon", @"date": @"2018-01-15T12:26:11.748Z", @"text": @"This service was installed automatically, no issues were noted in testing.", @"@type": @"Note" } ], @"@type": @"Service" } },
@"reportingSystem": @{ @"id": @"427", @"name": @"APP-755", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"source": @{ @"id": @"149", @"name": @"APP-78", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"@baseType": @"Event",
@"@type": @"ServiceCreateEvent" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listener/serviceCreateEvent"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/listener/serviceCreateEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listener/serviceCreateEvent",
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([
'correlationId' => 'b382501b-c423',
'description' => 'ServiceCreateEvent illustration',
'domain' => 'Commercial',
'eventId' => '4da6-b0f1-5a7fce3edc94',
'eventTime' => '2022-08-25T12:19:28.512Z',
'eventType' => 'ServiceCreateEvent',
'priority' => '4',
'timeOcurred' => '2022-08-25T12:19:28.180Z',
'title' => 'ServiceCreateEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'serviceType' => 'Cloud',
'name' => 'vCPE serial 1355615',
'description' => 'Instantiation of vCPE',
'state' => 'active',
'category' => 'CFS',
'isServiceEnabled' => null,
'hasStarted' => null,
'startMode' => '1',
'isStateful' => null,
'startDate' => '2018-01-15T12:26:11.747Z',
'serviceSpecification' => [
'id' => '1212',
'href' => 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
'name' => 'vCPE',
'version' => '1.0.0',
'@type' => 'ServiceSpecificationRef',
'@referredType' => 'ServiceSpecification'
],
'feature' => [
[
'id' => 'Feat1',
'isEnabled' => null,
'name' => 'ElasticBandwith',
'featureCharacteritic' => [
[
'name' => 'isCapped',
'value' => null,
'id' => '45gh-fg',
'valueType' => 'boolean',
'@type' => 'BooleanCharacteristic'
]
],
'@type' => 'Feature'
]
],
'serviceCharacteristic' => [
[
'id' => '452-gh6',
'name' => 'vCPE',
'valueType' => 'object',
'value' => [
'@type' => 'VCPE',
'@schemaLocation' => 'http://my.schemas/vCPE.schema.json',
'vCPE_IP' => '193.218.236.21',
'MaxTxRate' => 300,
'TransmitPower' => '11 dBm',
'maxTream' => 'OFF'
],
'@type' => 'ObjectCharacteristic'
]
],
'serviceRelationship' => [
[
'relationshipType' => 'DependentOn',
'ServiceRelationshipCharacteristic' => [
[
'id' => '126',
'name' => 'CrossRef',
'value' => '44-11-h',
'valueType' => 'string',
'@type' => 'StringCharacteristic'
]
],
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
'id' => '5645',
'@type' => 'ServiceRef',
'@referredType' => 'Service'
],
'@type' => 'ServiceRelationship'
]
],
'supportingService' => [
[
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
'id' => '5885',
'@type' => 'ServiceRef',
'@referredType' => 'Service'
]
],
'supportingResource' => [
[
'id' => '6161',
'href' => 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
'name' => 'GenInfra',
'@type' => 'ResourceRef',
'@referredType' => 'VirtualResource'
],
[
'id' => '7171',
'href' => 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
'name' => 'BNG_MUX',
'value' => '01 25 65',
'@type' => 'ResourceRef',
'@referredType' => 'VNF'
]
],
'relatedParty' => [
[
'role' => 'user',
'partyOrPartyRole' => [
'href' => 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
'id' => '456',
'name' => 'John Doe',
'@type' => 'PartyRef',
'@referredType' => 'Individual'
],
'@type' => 'RelatedPartyRefOrPartyRoleRef'
]
],
'serviceOrderItem' => [
[
'serviceOrderHref' => 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
'serviceOrderId' => '42',
'role' => 'initiator',
'@referredType' => 'ServiceOrderItem',
'@type' => 'RelatedServiceOrderItem',
'itemId' => '1',
'itemAction' => 'add'
],
[
'serviceOrderHref' => 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
'serviceOrderId' => '896',
'role' => 'activation',
'@referredType' => 'ServiceOrderItem',
'@type' => 'RelatedServiceOrderItem',
'itemId' => '4',
'itemAction' => 'modify'
]
],
'place' => [
[
'role' => 'InstallationAddress',
'place' => [
'href' => 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
'id' => '2435',
'name' => 'Customer primary location',
'@type' => 'PlaceRef',
'@referredType' => 'GeographicAddress'
],
'@type' => 'RelatedPlaceRefOrValue'
]
],
'note' => [
[
'id' => '77456',
'author' => 'Harvey Poupon',
'date' => '2018-01-15T12:26:11.748Z',
'text' => 'This service was installed automatically, no issues were noted in testing.',
'@type' => 'Note'
]
],
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceCreateEvent'
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listener/serviceCreateEvent', [
'body' => '{
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"supportingResource": [
{
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
},
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
},
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceCreateEvent"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listener/serviceCreateEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'correlationId' => 'b382501b-c423',
'description' => 'ServiceCreateEvent illustration',
'domain' => 'Commercial',
'eventId' => '4da6-b0f1-5a7fce3edc94',
'eventTime' => '2022-08-25T12:19:28.512Z',
'eventType' => 'ServiceCreateEvent',
'priority' => '4',
'timeOcurred' => '2022-08-25T12:19:28.180Z',
'title' => 'ServiceCreateEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'serviceType' => 'Cloud',
'name' => 'vCPE serial 1355615',
'description' => 'Instantiation of vCPE',
'state' => 'active',
'category' => 'CFS',
'isServiceEnabled' => null,
'hasStarted' => null,
'startMode' => '1',
'isStateful' => null,
'startDate' => '2018-01-15T12:26:11.747Z',
'serviceSpecification' => [
'id' => '1212',
'href' => 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
'name' => 'vCPE',
'version' => '1.0.0',
'@type' => 'ServiceSpecificationRef',
'@referredType' => 'ServiceSpecification'
],
'feature' => [
[
'id' => 'Feat1',
'isEnabled' => null,
'name' => 'ElasticBandwith',
'featureCharacteritic' => [
[
'name' => 'isCapped',
'value' => null,
'id' => '45gh-fg',
'valueType' => 'boolean',
'@type' => 'BooleanCharacteristic'
]
],
'@type' => 'Feature'
]
],
'serviceCharacteristic' => [
[
'id' => '452-gh6',
'name' => 'vCPE',
'valueType' => 'object',
'value' => [
'@type' => 'VCPE',
'@schemaLocation' => 'http://my.schemas/vCPE.schema.json',
'vCPE_IP' => '193.218.236.21',
'MaxTxRate' => 300,
'TransmitPower' => '11 dBm',
'maxTream' => 'OFF'
],
'@type' => 'ObjectCharacteristic'
]
],
'serviceRelationship' => [
[
'relationshipType' => 'DependentOn',
'ServiceRelationshipCharacteristic' => [
[
'id' => '126',
'name' => 'CrossRef',
'value' => '44-11-h',
'valueType' => 'string',
'@type' => 'StringCharacteristic'
]
],
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
'id' => '5645',
'@type' => 'ServiceRef',
'@referredType' => 'Service'
],
'@type' => 'ServiceRelationship'
]
],
'supportingService' => [
[
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
'id' => '5885',
'@type' => 'ServiceRef',
'@referredType' => 'Service'
]
],
'supportingResource' => [
[
'id' => '6161',
'href' => 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
'name' => 'GenInfra',
'@type' => 'ResourceRef',
'@referredType' => 'VirtualResource'
],
[
'id' => '7171',
'href' => 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
'name' => 'BNG_MUX',
'value' => '01 25 65',
'@type' => 'ResourceRef',
'@referredType' => 'VNF'
]
],
'relatedParty' => [
[
'role' => 'user',
'partyOrPartyRole' => [
'href' => 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
'id' => '456',
'name' => 'John Doe',
'@type' => 'PartyRef',
'@referredType' => 'Individual'
],
'@type' => 'RelatedPartyRefOrPartyRoleRef'
]
],
'serviceOrderItem' => [
[
'serviceOrderHref' => 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
'serviceOrderId' => '42',
'role' => 'initiator',
'@referredType' => 'ServiceOrderItem',
'@type' => 'RelatedServiceOrderItem',
'itemId' => '1',
'itemAction' => 'add'
],
[
'serviceOrderHref' => 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
'serviceOrderId' => '896',
'role' => 'activation',
'@referredType' => 'ServiceOrderItem',
'@type' => 'RelatedServiceOrderItem',
'itemId' => '4',
'itemAction' => 'modify'
]
],
'place' => [
[
'role' => 'InstallationAddress',
'place' => [
'href' => 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
'id' => '2435',
'name' => 'Customer primary location',
'@type' => 'PlaceRef',
'@referredType' => 'GeographicAddress'
],
'@type' => 'RelatedPlaceRefOrValue'
]
],
'note' => [
[
'id' => '77456',
'author' => 'Harvey Poupon',
'date' => '2018-01-15T12:26:11.748Z',
'text' => 'This service was installed automatically, no issues were noted in testing.',
'@type' => 'Note'
]
],
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceCreateEvent'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'correlationId' => 'b382501b-c423',
'description' => 'ServiceCreateEvent illustration',
'domain' => 'Commercial',
'eventId' => '4da6-b0f1-5a7fce3edc94',
'eventTime' => '2022-08-25T12:19:28.512Z',
'eventType' => 'ServiceCreateEvent',
'priority' => '4',
'timeOcurred' => '2022-08-25T12:19:28.180Z',
'title' => 'ServiceCreateEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'serviceType' => 'Cloud',
'name' => 'vCPE serial 1355615',
'description' => 'Instantiation of vCPE',
'state' => 'active',
'category' => 'CFS',
'isServiceEnabled' => null,
'hasStarted' => null,
'startMode' => '1',
'isStateful' => null,
'startDate' => '2018-01-15T12:26:11.747Z',
'serviceSpecification' => [
'id' => '1212',
'href' => 'https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212',
'name' => 'vCPE',
'version' => '1.0.0',
'@type' => 'ServiceSpecificationRef',
'@referredType' => 'ServiceSpecification'
],
'feature' => [
[
'id' => 'Feat1',
'isEnabled' => null,
'name' => 'ElasticBandwith',
'featureCharacteritic' => [
[
'name' => 'isCapped',
'value' => null,
'id' => '45gh-fg',
'valueType' => 'boolean',
'@type' => 'BooleanCharacteristic'
]
],
'@type' => 'Feature'
]
],
'serviceCharacteristic' => [
[
'id' => '452-gh6',
'name' => 'vCPE',
'valueType' => 'object',
'value' => [
'@type' => 'VCPE',
'@schemaLocation' => 'http://my.schemas/vCPE.schema.json',
'vCPE_IP' => '193.218.236.21',
'MaxTxRate' => 300,
'TransmitPower' => '11 dBm',
'maxTream' => 'OFF'
],
'@type' => 'ObjectCharacteristic'
]
],
'serviceRelationship' => [
[
'relationshipType' => 'DependentOn',
'ServiceRelationshipCharacteristic' => [
[
'id' => '126',
'name' => 'CrossRef',
'value' => '44-11-h',
'valueType' => 'string',
'@type' => 'StringCharacteristic'
]
],
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645',
'id' => '5645',
'@type' => 'ServiceRef',
'@referredType' => 'Service'
],
'@type' => 'ServiceRelationship'
]
],
'supportingService' => [
[
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885',
'id' => '5885',
'@type' => 'ServiceRef',
'@referredType' => 'Service'
]
],
'supportingResource' => [
[
'id' => '6161',
'href' => 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351',
'name' => 'GenInfra',
'@type' => 'ResourceRef',
'@referredType' => 'VirtualResource'
],
[
'id' => '7171',
'href' => 'https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171',
'name' => 'BNG_MUX',
'value' => '01 25 65',
'@type' => 'ResourceRef',
'@referredType' => 'VNF'
]
],
'relatedParty' => [
[
'role' => 'user',
'partyOrPartyRole' => [
'href' => 'https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456',
'id' => '456',
'name' => 'John Doe',
'@type' => 'PartyRef',
'@referredType' => 'Individual'
],
'@type' => 'RelatedPartyRefOrPartyRoleRef'
]
],
'serviceOrderItem' => [
[
'serviceOrderHref' => 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42',
'serviceOrderId' => '42',
'role' => 'initiator',
'@referredType' => 'ServiceOrderItem',
'@type' => 'RelatedServiceOrderItem',
'itemId' => '1',
'itemAction' => 'add'
],
[
'serviceOrderHref' => 'https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896',
'serviceOrderId' => '896',
'role' => 'activation',
'@referredType' => 'ServiceOrderItem',
'@type' => 'RelatedServiceOrderItem',
'itemId' => '4',
'itemAction' => 'modify'
]
],
'place' => [
[
'role' => 'InstallationAddress',
'place' => [
'href' => 'https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435',
'id' => '2435',
'name' => 'Customer primary location',
'@type' => 'PlaceRef',
'@referredType' => 'GeographicAddress'
],
'@type' => 'RelatedPlaceRefOrValue'
]
],
'note' => [
[
'id' => '77456',
'author' => 'Harvey Poupon',
'date' => '2018-01-15T12:26:11.748Z',
'text' => 'This service was installed automatically, no issues were noted in testing.',
'@type' => 'Note'
]
],
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceCreateEvent'
]));
$request->setRequestUrl('{{baseUrl}}/listener/serviceCreateEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listener/serviceCreateEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"supportingResource": [
{
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
},
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
},
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceCreateEvent"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listener/serviceCreateEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"supportingResource": [
{
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
},
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
},
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceCreateEvent"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listener/serviceCreateEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listener/serviceCreateEvent"
payload = {
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": { "service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": True,
"hasStarted": True,
"startMode": "1",
"isStateful": True,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": True,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"name": "isCapped",
"value": True,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"supportingResource": [
{
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
},
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
},
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
} },
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceCreateEvent"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listener/serviceCreateEvent"
payload <- "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listener/serviceCreateEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/listener/serviceCreateEvent') do |req|
req.body = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceCreateEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceCreateEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceCreateEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"serviceType\": \"Cloud\",\n \"name\": \"vCPE serial 1355615\",\n \"description\": \"Instantiation of vCPE\",\n \"state\": \"active\",\n \"category\": \"CFS\",\n \"isServiceEnabled\": true,\n \"hasStarted\": true,\n \"startMode\": \"1\",\n \"isStateful\": true,\n \"startDate\": \"2018-01-15T12:26:11.747Z\",\n \"serviceSpecification\": {\n \"id\": \"1212\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212\",\n \"name\": \"vCPE\",\n \"version\": \"1.0.0\",\n \"@type\": \"ServiceSpecificationRef\",\n \"@referredType\": \"ServiceSpecification\"\n },\n \"feature\": [\n {\n \"id\": \"Feat1\",\n \"isEnabled\": true,\n \"name\": \"ElasticBandwith\",\n \"featureCharacteritic\": [\n {\n \"name\": \"isCapped\",\n \"value\": true,\n \"id\": \"45gh-fg\",\n \"valueType\": \"boolean\",\n \"@type\": \"BooleanCharacteristic\"\n }\n ],\n \"@type\": \"Feature\"\n }\n ],\n \"serviceCharacteristic\": [\n {\n \"id\": \"452-gh6\",\n \"name\": \"vCPE\",\n \"valueType\": \"object\",\n \"value\": {\n \"@type\": \"VCPE\",\n \"@schemaLocation\": \"http://my.schemas/vCPE.schema.json\",\n \"vCPE_IP\": \"193.218.236.21\",\n \"MaxTxRate\": 300,\n \"TransmitPower\": \"11 dBm\",\n \"maxTream\": \"OFF\"\n },\n \"@type\": \"ObjectCharacteristic\"\n }\n ],\n \"serviceRelationship\": [\n {\n \"relationshipType\": \"DependentOn\",\n \"ServiceRelationshipCharacteristic\": [\n {\n \"id\": \"126\",\n \"name\": \"CrossRef\",\n \"value\": \"44-11-h\",\n \"valueType\": \"string\",\n \"@type\": \"StringCharacteristic\"\n }\n ],\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645\",\n \"id\": \"5645\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n },\n \"@type\": \"ServiceRelationship\"\n }\n ],\n \"supportingService\": [\n {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885\",\n \"id\": \"5885\",\n \"@type\": \"ServiceRef\",\n \"@referredType\": \"Service\"\n }\n ],\n \"supportingResource\": [\n {\n \"id\": \"6161\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351\",\n \"name\": \"GenInfra\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VirtualResource\"\n },\n {\n \"id\": \"7171\",\n \"href\": \"https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171\",\n \"name\": \"BNG_MUX\",\n \"value\": \"01 25 65\",\n \"@type\": \"ResourceRef\",\n \"@referredType\": \"VNF\"\n }\n ],\n \"relatedParty\": [\n {\n \"role\": \"user\",\n \"partyOrPartyRole\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456\",\n \"id\": \"456\",\n \"name\": \"John Doe\",\n \"@type\": \"PartyRef\",\n \"@referredType\": \"Individual\"\n },\n \"@type\": \"RelatedPartyRefOrPartyRoleRef\"\n }\n ],\n \"serviceOrderItem\": [\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42\",\n \"serviceOrderId\": \"42\",\n \"role\": \"initiator\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"1\",\n \"itemAction\": \"add\"\n },\n {\n \"serviceOrderHref\": \"https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896\",\n \"serviceOrderId\": \"896\",\n \"role\": \"activation\",\n \"@referredType\": \"ServiceOrderItem\",\n \"@type\": \"RelatedServiceOrderItem\",\n \"itemId\": \"4\",\n \"itemAction\": \"modify\"\n }\n ],\n \"place\": [\n {\n \"role\": \"InstallationAddress\",\n \"place\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435\",\n \"id\": \"2435\",\n \"name\": \"Customer primary location\",\n \"@type\": \"PlaceRef\",\n \"@referredType\": \"GeographicAddress\"\n },\n \"@type\": \"RelatedPlaceRefOrValue\"\n }\n ],\n \"note\": [\n {\n \"id\": \"77456\",\n \"author\": \"Harvey Poupon\",\n \"date\": \"2018-01-15T12:26:11.748Z\",\n \"text\": \"This service was installed automatically, no issues were noted in testing.\",\n \"@type\": \"Note\"\n }\n ],\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceCreateEvent\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/listener/serviceCreateEvent";
let payload = json!({
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": json!({"service": json!({
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": json!({
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
}),
"feature": (
json!({
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": (
json!({
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
})
),
"@type": "Feature"
})
),
"serviceCharacteristic": (
json!({
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": json!({
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
}),
"@type": "ObjectCharacteristic"
})
),
"serviceRelationship": (
json!({
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": (
json!({
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
})
),
"service": json!({
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
}),
"@type": "ServiceRelationship"
})
),
"supportingService": (
json!({
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
})
),
"supportingResource": (
json!({
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
}),
json!({
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
})
),
"relatedParty": (
json!({
"role": "user",
"partyOrPartyRole": json!({
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
}),
"@type": "RelatedPartyRefOrPartyRoleRef"
})
),
"serviceOrderItem": (
json!({
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
}),
json!({
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
})
),
"place": (
json!({
"role": "InstallationAddress",
"place": json!({
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
}),
"@type": "RelatedPlaceRefOrValue"
})
),
"note": (
json!({
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
})
),
"@type": "Service"
})}),
"reportingSystem": json!({
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"source": json!({
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"@baseType": "Event",
"@type": "ServiceCreateEvent"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/listener/serviceCreateEvent \
--header 'content-type: application/json' \
--data '{
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"supportingResource": [
{
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
},
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
},
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceCreateEvent"
}'
echo '{
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"supportingResource": [
{
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
},
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
},
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceCreateEvent"
}' | \
http POST {{baseUrl}}/listener/serviceCreateEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "correlationId": "b382501b-c423",\n "description": "ServiceCreateEvent illustration",\n "domain": "Commercial",\n "eventId": "4da6-b0f1-5a7fce3edc94",\n "eventTime": "2022-08-25T12:19:28.512Z",\n "eventType": "ServiceCreateEvent",\n "priority": "4",\n "timeOcurred": "2022-08-25T12:19:28.180Z",\n "title": "ServiceCreateEvent",\n "event": {\n "service": {\n "id": "5351",\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "serviceType": "Cloud",\n "name": "vCPE serial 1355615",\n "description": "Instantiation of vCPE",\n "state": "active",\n "category": "CFS",\n "isServiceEnabled": true,\n "hasStarted": true,\n "startMode": "1",\n "isStateful": true,\n "startDate": "2018-01-15T12:26:11.747Z",\n "serviceSpecification": {\n "id": "1212",\n "href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",\n "name": "vCPE",\n "version": "1.0.0",\n "@type": "ServiceSpecificationRef",\n "@referredType": "ServiceSpecification"\n },\n "feature": [\n {\n "id": "Feat1",\n "isEnabled": true,\n "name": "ElasticBandwith",\n "featureCharacteritic": [\n {\n "name": "isCapped",\n "value": true,\n "id": "45gh-fg",\n "valueType": "boolean",\n "@type": "BooleanCharacteristic"\n }\n ],\n "@type": "Feature"\n }\n ],\n "serviceCharacteristic": [\n {\n "id": "452-gh6",\n "name": "vCPE",\n "valueType": "object",\n "value": {\n "@type": "VCPE",\n "@schemaLocation": "http://my.schemas/vCPE.schema.json",\n "vCPE_IP": "193.218.236.21",\n "MaxTxRate": 300,\n "TransmitPower": "11 dBm",\n "maxTream": "OFF"\n },\n "@type": "ObjectCharacteristic"\n }\n ],\n "serviceRelationship": [\n {\n "relationshipType": "DependentOn",\n "ServiceRelationshipCharacteristic": [\n {\n "id": "126",\n "name": "CrossRef",\n "value": "44-11-h",\n "valueType": "string",\n "@type": "StringCharacteristic"\n }\n ],\n "service": {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",\n "id": "5645",\n "@type": "ServiceRef",\n "@referredType": "Service"\n },\n "@type": "ServiceRelationship"\n }\n ],\n "supportingService": [\n {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",\n "id": "5885",\n "@type": "ServiceRef",\n "@referredType": "Service"\n }\n ],\n "supportingResource": [\n {\n "id": "6161",\n "href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",\n "name": "GenInfra",\n "@type": "ResourceRef",\n "@referredType": "VirtualResource"\n },\n {\n "id": "7171",\n "href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",\n "name": "BNG_MUX",\n "value": "01 25 65",\n "@type": "ResourceRef",\n "@referredType": "VNF"\n }\n ],\n "relatedParty": [\n {\n "role": "user",\n "partyOrPartyRole": {\n "href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",\n "id": "456",\n "name": "John Doe",\n "@type": "PartyRef",\n "@referredType": "Individual"\n },\n "@type": "RelatedPartyRefOrPartyRoleRef"\n }\n ],\n "serviceOrderItem": [\n {\n "serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",\n "serviceOrderId": "42",\n "role": "initiator",\n "@referredType": "ServiceOrderItem",\n "@type": "RelatedServiceOrderItem",\n "itemId": "1",\n "itemAction": "add"\n },\n {\n "serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",\n "serviceOrderId": "896",\n "role": "activation",\n "@referredType": "ServiceOrderItem",\n "@type": "RelatedServiceOrderItem",\n "itemId": "4",\n "itemAction": "modify"\n }\n ],\n "place": [\n {\n "role": "InstallationAddress",\n "place": {\n "href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",\n "id": "2435",\n "name": "Customer primary location",\n "@type": "PlaceRef",\n "@referredType": "GeographicAddress"\n },\n "@type": "RelatedPlaceRefOrValue"\n }\n ],\n "note": [\n {\n "id": "77456",\n "author": "Harvey Poupon",\n "date": "2018-01-15T12:26:11.748Z",\n "text": "This service was installed automatically, no issues were noted in testing.",\n "@type": "Note"\n }\n ],\n "@type": "Service"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceCreateEvent"\n}' \
--output-document \
- {{baseUrl}}/listener/serviceCreateEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"correlationId": "b382501b-c423",
"description": "ServiceCreateEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceCreateEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceCreateEvent",
"event": ["service": [
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": [
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
],
"feature": [
[
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
[
"name": "isCapped",
"value": true,
"id": "45gh-fg",
"valueType": "boolean",
"@type": "BooleanCharacteristic"
]
],
"@type": "Feature"
]
],
"serviceCharacteristic": [
[
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": [
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/vCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
],
"@type": "ObjectCharacteristic"
]
],
"serviceRelationship": [
[
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
[
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
]
],
"service": [
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
],
"@type": "ServiceRelationship"
]
],
"supportingService": [
[
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
]
],
"supportingResource": [
[
"id": "6161",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/5351",
"name": "GenInfra",
"@type": "ResourceRef",
"@referredType": "VirtualResource"
],
[
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
]
],
"relatedParty": [
[
"role": "user",
"partyOrPartyRole": [
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
],
"@type": "RelatedPartyRefOrPartyRoleRef"
]
],
"serviceOrderItem": [
[
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
],
[
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrder/v5/serviceOrder/896",
"serviceOrderId": "896",
"role": "activation",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "4",
"itemAction": "modify"
]
],
"place": [
[
"role": "InstallationAddress",
"place": [
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
],
"@type": "RelatedPlaceRefOrValue"
]
],
"note": [
[
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
]
],
"@type": "Service"
]],
"reportingSystem": [
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"source": [
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"@baseType": "Event",
"@type": "ServiceCreateEvent"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listener/serviceCreateEvent")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Client listener for entity ServiceDeleteEvent
{{baseUrl}}/listener/serviceDeleteEvent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listener/serviceDeleteEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listener/serviceDeleteEvent" {:content-type :json
:form-params {:correlationId "36af9e61-4a51"
:description "ServiceDeleteEvent illustration"
:domain "Commercial"
:eventId "4154-a76e-bf08c4bccb2e"
:eventTime "2022-08-25T12:19:28.549Z"
:eventType "ServiceDeleteEvent"
:priority "1"
:timeOcurred "2022-08-25T12:19:24.023Z"
:title "ServiceDeleteEvent"
:event {:service {:id "5351"
:href "http://servername/service/5351"
:@type "Service"}}
:reportingSystem {:id "427"
:name "APP-755"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:source {:id "149"
:name "APP-78"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:@baseType "Event"
:@type "ServiceDeleteEvent"}})
require "http/client"
url = "{{baseUrl}}/listener/serviceDeleteEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/listener/serviceDeleteEvent"),
Content = new StringContent("{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/listener/serviceDeleteEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listener/serviceDeleteEvent"
payload := strings.NewReader("{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/listener/serviceDeleteEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 795
{
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": {
"service": {
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listener/serviceDeleteEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listener/serviceDeleteEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listener/serviceDeleteEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listener/serviceDeleteEvent")
.header("content-type", "application/json")
.body("{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}")
.asString();
const data = JSON.stringify({
correlationId: '36af9e61-4a51',
description: 'ServiceDeleteEvent illustration',
domain: 'Commercial',
eventId: '4154-a76e-bf08c4bccb2e',
eventTime: '2022-08-25T12:19:28.549Z',
eventType: 'ServiceDeleteEvent',
priority: '1',
timeOcurred: '2022-08-25T12:19:24.023Z',
title: 'ServiceDeleteEvent',
event: {
service: {
id: '5351',
href: 'http://servername/service/5351',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceDeleteEvent'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/listener/serviceDeleteEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceDeleteEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: '36af9e61-4a51',
description: 'ServiceDeleteEvent illustration',
domain: 'Commercial',
eventId: '4154-a76e-bf08c4bccb2e',
eventTime: '2022-08-25T12:19:28.549Z',
eventType: 'ServiceDeleteEvent',
priority: '1',
timeOcurred: '2022-08-25T12:19:24.023Z',
title: 'ServiceDeleteEvent',
event: {
service: {id: '5351', href: 'http://servername/service/5351', '@type': 'Service'}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceDeleteEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listener/serviceDeleteEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"36af9e61-4a51","description":"ServiceDeleteEvent illustration","domain":"Commercial","eventId":"4154-a76e-bf08c4bccb2e","eventTime":"2022-08-25T12:19:28.549Z","eventType":"ServiceDeleteEvent","priority":"1","timeOcurred":"2022-08-25T12:19:24.023Z","title":"ServiceDeleteEvent","event":{"service":{"id":"5351","href":"http://servername/service/5351","@type":"Service"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceDeleteEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/listener/serviceDeleteEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "correlationId": "36af9e61-4a51",\n "description": "ServiceDeleteEvent illustration",\n "domain": "Commercial",\n "eventId": "4154-a76e-bf08c4bccb2e",\n "eventTime": "2022-08-25T12:19:28.549Z",\n "eventType": "ServiceDeleteEvent",\n "priority": "1",\n "timeOcurred": "2022-08-25T12:19:24.023Z",\n "title": "ServiceDeleteEvent",\n "event": {\n "service": {\n "id": "5351",\n "href": "http://servername/service/5351",\n "@type": "Service"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceDeleteEvent"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listener/serviceDeleteEvent")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/listener/serviceDeleteEvent',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
correlationId: '36af9e61-4a51',
description: 'ServiceDeleteEvent illustration',
domain: 'Commercial',
eventId: '4154-a76e-bf08c4bccb2e',
eventTime: '2022-08-25T12:19:28.549Z',
eventType: 'ServiceDeleteEvent',
priority: '1',
timeOcurred: '2022-08-25T12:19:24.023Z',
title: 'ServiceDeleteEvent',
event: {
service: {id: '5351', href: 'http://servername/service/5351', '@type': 'Service'}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceDeleteEvent'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceDeleteEvent',
headers: {'content-type': 'application/json'},
body: {
correlationId: '36af9e61-4a51',
description: 'ServiceDeleteEvent illustration',
domain: 'Commercial',
eventId: '4154-a76e-bf08c4bccb2e',
eventTime: '2022-08-25T12:19:28.549Z',
eventType: 'ServiceDeleteEvent',
priority: '1',
timeOcurred: '2022-08-25T12:19:24.023Z',
title: 'ServiceDeleteEvent',
event: {
service: {id: '5351', href: 'http://servername/service/5351', '@type': 'Service'}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceDeleteEvent'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/listener/serviceDeleteEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
correlationId: '36af9e61-4a51',
description: 'ServiceDeleteEvent illustration',
domain: 'Commercial',
eventId: '4154-a76e-bf08c4bccb2e',
eventTime: '2022-08-25T12:19:28.549Z',
eventType: 'ServiceDeleteEvent',
priority: '1',
timeOcurred: '2022-08-25T12:19:24.023Z',
title: 'ServiceDeleteEvent',
event: {
service: {
id: '5351',
href: 'http://servername/service/5351',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceDeleteEvent'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceDeleteEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: '36af9e61-4a51',
description: 'ServiceDeleteEvent illustration',
domain: 'Commercial',
eventId: '4154-a76e-bf08c4bccb2e',
eventTime: '2022-08-25T12:19:28.549Z',
eventType: 'ServiceDeleteEvent',
priority: '1',
timeOcurred: '2022-08-25T12:19:24.023Z',
title: 'ServiceDeleteEvent',
event: {
service: {id: '5351', href: 'http://servername/service/5351', '@type': 'Service'}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceDeleteEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listener/serviceDeleteEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"36af9e61-4a51","description":"ServiceDeleteEvent illustration","domain":"Commercial","eventId":"4154-a76e-bf08c4bccb2e","eventTime":"2022-08-25T12:19:28.549Z","eventType":"ServiceDeleteEvent","priority":"1","timeOcurred":"2022-08-25T12:19:24.023Z","title":"ServiceDeleteEvent","event":{"service":{"id":"5351","href":"http://servername/service/5351","@type":"Service"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceDeleteEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"correlationId": @"36af9e61-4a51",
@"description": @"ServiceDeleteEvent illustration",
@"domain": @"Commercial",
@"eventId": @"4154-a76e-bf08c4bccb2e",
@"eventTime": @"2022-08-25T12:19:28.549Z",
@"eventType": @"ServiceDeleteEvent",
@"priority": @"1",
@"timeOcurred": @"2022-08-25T12:19:24.023Z",
@"title": @"ServiceDeleteEvent",
@"event": @{ @"service": @{ @"id": @"5351", @"href": @"http://servername/service/5351", @"@type": @"Service" } },
@"reportingSystem": @{ @"id": @"427", @"name": @"APP-755", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"source": @{ @"id": @"149", @"name": @"APP-78", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"@baseType": @"Event",
@"@type": @"ServiceDeleteEvent" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listener/serviceDeleteEvent"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/listener/serviceDeleteEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listener/serviceDeleteEvent",
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([
'correlationId' => '36af9e61-4a51',
'description' => 'ServiceDeleteEvent illustration',
'domain' => 'Commercial',
'eventId' => '4154-a76e-bf08c4bccb2e',
'eventTime' => '2022-08-25T12:19:28.549Z',
'eventType' => 'ServiceDeleteEvent',
'priority' => '1',
'timeOcurred' => '2022-08-25T12:19:24.023Z',
'title' => 'ServiceDeleteEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'http://servername/service/5351',
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceDeleteEvent'
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listener/serviceDeleteEvent', [
'body' => '{
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": {
"service": {
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listener/serviceDeleteEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'correlationId' => '36af9e61-4a51',
'description' => 'ServiceDeleteEvent illustration',
'domain' => 'Commercial',
'eventId' => '4154-a76e-bf08c4bccb2e',
'eventTime' => '2022-08-25T12:19:28.549Z',
'eventType' => 'ServiceDeleteEvent',
'priority' => '1',
'timeOcurred' => '2022-08-25T12:19:24.023Z',
'title' => 'ServiceDeleteEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'http://servername/service/5351',
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceDeleteEvent'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'correlationId' => '36af9e61-4a51',
'description' => 'ServiceDeleteEvent illustration',
'domain' => 'Commercial',
'eventId' => '4154-a76e-bf08c4bccb2e',
'eventTime' => '2022-08-25T12:19:28.549Z',
'eventType' => 'ServiceDeleteEvent',
'priority' => '1',
'timeOcurred' => '2022-08-25T12:19:24.023Z',
'title' => 'ServiceDeleteEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'http://servername/service/5351',
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceDeleteEvent'
]));
$request->setRequestUrl('{{baseUrl}}/listener/serviceDeleteEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listener/serviceDeleteEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": {
"service": {
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listener/serviceDeleteEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": {
"service": {
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listener/serviceDeleteEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listener/serviceDeleteEvent"
payload = {
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": { "service": {
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
} },
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listener/serviceDeleteEvent"
payload <- "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listener/serviceDeleteEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/listener/serviceDeleteEvent') do |req|
req.body = "{\n \"correlationId\": \"36af9e61-4a51\",\n \"description\": \"ServiceDeleteEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4154-a76e-bf08c4bccb2e\",\n \"eventTime\": \"2022-08-25T12:19:28.549Z\",\n \"eventType\": \"ServiceDeleteEvent\",\n \"priority\": \"1\",\n \"timeOcurred\": \"2022-08-25T12:19:24.023Z\",\n \"title\": \"ServiceDeleteEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"http://servername/service/5351\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceDeleteEvent\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/listener/serviceDeleteEvent";
let payload = json!({
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": json!({"service": json!({
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
})}),
"reportingSystem": json!({
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"source": json!({
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/listener/serviceDeleteEvent \
--header 'content-type: application/json' \
--data '{
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": {
"service": {
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
}'
echo '{
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": {
"service": {
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
}' | \
http POST {{baseUrl}}/listener/serviceDeleteEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "correlationId": "36af9e61-4a51",\n "description": "ServiceDeleteEvent illustration",\n "domain": "Commercial",\n "eventId": "4154-a76e-bf08c4bccb2e",\n "eventTime": "2022-08-25T12:19:28.549Z",\n "eventType": "ServiceDeleteEvent",\n "priority": "1",\n "timeOcurred": "2022-08-25T12:19:24.023Z",\n "title": "ServiceDeleteEvent",\n "event": {\n "service": {\n "id": "5351",\n "href": "http://servername/service/5351",\n "@type": "Service"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceDeleteEvent"\n}' \
--output-document \
- {{baseUrl}}/listener/serviceDeleteEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"correlationId": "36af9e61-4a51",
"description": "ServiceDeleteEvent illustration",
"domain": "Commercial",
"eventId": "4154-a76e-bf08c4bccb2e",
"eventTime": "2022-08-25T12:19:28.549Z",
"eventType": "ServiceDeleteEvent",
"priority": "1",
"timeOcurred": "2022-08-25T12:19:24.023Z",
"title": "ServiceDeleteEvent",
"event": ["service": [
"id": "5351",
"href": "http://servername/service/5351",
"@type": "Service"
]],
"reportingSystem": [
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"source": [
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"@baseType": "Event",
"@type": "ServiceDeleteEvent"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listener/serviceDeleteEvent")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Client listener for entity ServiceOperatingStatusChangeEvent
{{baseUrl}}/listener/serviceOperatingStatusChangeEvent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent" {:content-type :json
:form-params {:correlationId "b382501b-c423"
:description "ServiceOperatingStatusChangeEvent illustration"
:domain "Commercial"
:eventId "4da6-b0f1-5a7fce3edc94"
:eventTime "2022-08-25T12:19:28.512Z"
:eventType "ServiceOperatingStatusChangeEvent"
:priority "4"
:timeOcurred "2022-08-25T12:19:28.180Z"
:title "ServiceOperatingStatusChangeEvent"
:event {:service {:id "5351"
:href "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351"
:operatingStatus "running"
:@type "Service"}}
:reportingSystem {:id "427"
:name "APP-755"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:source {:id "149"
:name "APP-78"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:@baseType "Event"
:@type "ServiceOperatingStatusChangeEvent"}})
require "http/client"
url = "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/listener/serviceOperatingStatusChangeEvent"),
Content = new StringContent("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/listener/serviceOperatingStatusChangeEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent"
payload := strings.NewReader("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/listener/serviceOperatingStatusChangeEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 924
{
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listener/serviceOperatingStatusChangeEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listener/serviceOperatingStatusChangeEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listener/serviceOperatingStatusChangeEvent")
.header("content-type", "application/json")
.body("{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}")
.asString();
const data = JSON.stringify({
correlationId: 'b382501b-c423',
description: 'ServiceOperatingStatusChangeEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceOperatingStatusChangeEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceOperatingStatusChangeEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
operatingStatus: 'running',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceOperatingStatusChangeEvent'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: 'b382501b-c423',
description: 'ServiceOperatingStatusChangeEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceOperatingStatusChangeEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceOperatingStatusChangeEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
operatingStatus: 'running',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceOperatingStatusChangeEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"b382501b-c423","description":"ServiceOperatingStatusChangeEvent illustration","domain":"Commercial","eventId":"4da6-b0f1-5a7fce3edc94","eventTime":"2022-08-25T12:19:28.512Z","eventType":"ServiceOperatingStatusChangeEvent","priority":"4","timeOcurred":"2022-08-25T12:19:28.180Z","title":"ServiceOperatingStatusChangeEvent","event":{"service":{"id":"5351","href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","operatingStatus":"running","@type":"Service"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceOperatingStatusChangeEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "correlationId": "b382501b-c423",\n "description": "ServiceOperatingStatusChangeEvent illustration",\n "domain": "Commercial",\n "eventId": "4da6-b0f1-5a7fce3edc94",\n "eventTime": "2022-08-25T12:19:28.512Z",\n "eventType": "ServiceOperatingStatusChangeEvent",\n "priority": "4",\n "timeOcurred": "2022-08-25T12:19:28.180Z",\n "title": "ServiceOperatingStatusChangeEvent",\n "event": {\n "service": {\n "id": "5351",\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "operatingStatus": "running",\n "@type": "Service"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceOperatingStatusChangeEvent"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listener/serviceOperatingStatusChangeEvent")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/listener/serviceOperatingStatusChangeEvent',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
correlationId: 'b382501b-c423',
description: 'ServiceOperatingStatusChangeEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceOperatingStatusChangeEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceOperatingStatusChangeEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
operatingStatus: 'running',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceOperatingStatusChangeEvent'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent',
headers: {'content-type': 'application/json'},
body: {
correlationId: 'b382501b-c423',
description: 'ServiceOperatingStatusChangeEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceOperatingStatusChangeEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceOperatingStatusChangeEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
operatingStatus: 'running',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceOperatingStatusChangeEvent'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
correlationId: 'b382501b-c423',
description: 'ServiceOperatingStatusChangeEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceOperatingStatusChangeEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceOperatingStatusChangeEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
operatingStatus: 'running',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceOperatingStatusChangeEvent'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: 'b382501b-c423',
description: 'ServiceOperatingStatusChangeEvent illustration',
domain: 'Commercial',
eventId: '4da6-b0f1-5a7fce3edc94',
eventTime: '2022-08-25T12:19:28.512Z',
eventType: 'ServiceOperatingStatusChangeEvent',
priority: '4',
timeOcurred: '2022-08-25T12:19:28.180Z',
title: 'ServiceOperatingStatusChangeEvent',
event: {
service: {
id: '5351',
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
operatingStatus: 'running',
'@type': 'Service'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceOperatingStatusChangeEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"b382501b-c423","description":"ServiceOperatingStatusChangeEvent illustration","domain":"Commercial","eventId":"4da6-b0f1-5a7fce3edc94","eventTime":"2022-08-25T12:19:28.512Z","eventType":"ServiceOperatingStatusChangeEvent","priority":"4","timeOcurred":"2022-08-25T12:19:28.180Z","title":"ServiceOperatingStatusChangeEvent","event":{"service":{"id":"5351","href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","operatingStatus":"running","@type":"Service"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceOperatingStatusChangeEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"correlationId": @"b382501b-c423",
@"description": @"ServiceOperatingStatusChangeEvent illustration",
@"domain": @"Commercial",
@"eventId": @"4da6-b0f1-5a7fce3edc94",
@"eventTime": @"2022-08-25T12:19:28.512Z",
@"eventType": @"ServiceOperatingStatusChangeEvent",
@"priority": @"4",
@"timeOcurred": @"2022-08-25T12:19:28.180Z",
@"title": @"ServiceOperatingStatusChangeEvent",
@"event": @{ @"service": @{ @"id": @"5351", @"href": @"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351", @"operatingStatus": @"running", @"@type": @"Service" } },
@"reportingSystem": @{ @"id": @"427", @"name": @"APP-755", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"source": @{ @"id": @"149", @"name": @"APP-78", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"@baseType": @"Event",
@"@type": @"ServiceOperatingStatusChangeEvent" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listener/serviceOperatingStatusChangeEvent"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listener/serviceOperatingStatusChangeEvent",
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([
'correlationId' => 'b382501b-c423',
'description' => 'ServiceOperatingStatusChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '4da6-b0f1-5a7fce3edc94',
'eventTime' => '2022-08-25T12:19:28.512Z',
'eventType' => 'ServiceOperatingStatusChangeEvent',
'priority' => '4',
'timeOcurred' => '2022-08-25T12:19:28.180Z',
'title' => 'ServiceOperatingStatusChangeEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'operatingStatus' => 'running',
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceOperatingStatusChangeEvent'
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent', [
'body' => '{
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listener/serviceOperatingStatusChangeEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'correlationId' => 'b382501b-c423',
'description' => 'ServiceOperatingStatusChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '4da6-b0f1-5a7fce3edc94',
'eventTime' => '2022-08-25T12:19:28.512Z',
'eventType' => 'ServiceOperatingStatusChangeEvent',
'priority' => '4',
'timeOcurred' => '2022-08-25T12:19:28.180Z',
'title' => 'ServiceOperatingStatusChangeEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'operatingStatus' => 'running',
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceOperatingStatusChangeEvent'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'correlationId' => 'b382501b-c423',
'description' => 'ServiceOperatingStatusChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '4da6-b0f1-5a7fce3edc94',
'eventTime' => '2022-08-25T12:19:28.512Z',
'eventType' => 'ServiceOperatingStatusChangeEvent',
'priority' => '4',
'timeOcurred' => '2022-08-25T12:19:28.180Z',
'title' => 'ServiceOperatingStatusChangeEvent',
'event' => [
'service' => [
'id' => '5351',
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'operatingStatus' => 'running',
'@type' => 'Service'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceOperatingStatusChangeEvent'
]));
$request->setRequestUrl('{{baseUrl}}/listener/serviceOperatingStatusChangeEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listener/serviceOperatingStatusChangeEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listener/serviceOperatingStatusChangeEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent"
payload = {
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": { "service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
} },
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent"
payload <- "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listener/serviceOperatingStatusChangeEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/listener/serviceOperatingStatusChangeEvent') do |req|
req.body = "{\n \"correlationId\": \"b382501b-c423\",\n \"description\": \"ServiceOperatingStatusChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"4da6-b0f1-5a7fce3edc94\",\n \"eventTime\": \"2022-08-25T12:19:28.512Z\",\n \"eventType\": \"ServiceOperatingStatusChangeEvent\",\n \"priority\": \"4\",\n \"timeOcurred\": \"2022-08-25T12:19:28.180Z\",\n \"title\": \"ServiceOperatingStatusChangeEvent\",\n \"event\": {\n \"service\": {\n \"id\": \"5351\",\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"operatingStatus\": \"running\",\n \"@type\": \"Service\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceOperatingStatusChangeEvent\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent";
let payload = json!({
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": json!({"service": json!({
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
})}),
"reportingSystem": json!({
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"source": json!({
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/listener/serviceOperatingStatusChangeEvent \
--header 'content-type: application/json' \
--data '{
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
}'
echo '{
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": {
"service": {
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
}' | \
http POST {{baseUrl}}/listener/serviceOperatingStatusChangeEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "correlationId": "b382501b-c423",\n "description": "ServiceOperatingStatusChangeEvent illustration",\n "domain": "Commercial",\n "eventId": "4da6-b0f1-5a7fce3edc94",\n "eventTime": "2022-08-25T12:19:28.512Z",\n "eventType": "ServiceOperatingStatusChangeEvent",\n "priority": "4",\n "timeOcurred": "2022-08-25T12:19:28.180Z",\n "title": "ServiceOperatingStatusChangeEvent",\n "event": {\n "service": {\n "id": "5351",\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "operatingStatus": "running",\n "@type": "Service"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceOperatingStatusChangeEvent"\n}' \
--output-document \
- {{baseUrl}}/listener/serviceOperatingStatusChangeEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"correlationId": "b382501b-c423",
"description": "ServiceOperatingStatusChangeEvent illustration",
"domain": "Commercial",
"eventId": "4da6-b0f1-5a7fce3edc94",
"eventTime": "2022-08-25T12:19:28.512Z",
"eventType": "ServiceOperatingStatusChangeEvent",
"priority": "4",
"timeOcurred": "2022-08-25T12:19:28.180Z",
"title": "ServiceOperatingStatusChangeEvent",
"event": ["service": [
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"operatingStatus": "running",
"@type": "Service"
]],
"reportingSystem": [
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"source": [
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"@baseType": "Event",
"@type": "ServiceOperatingStatusChangeEvent"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listener/serviceOperatingStatusChangeEvent")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Client listener for entity ServiceStateChangeEvent
{{baseUrl}}/listener/serviceStateChangeEvent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/listener/serviceStateChangeEvent");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/listener/serviceStateChangeEvent" {:content-type :json
:form-params {:correlationId "9b374459-e9b0"
:description "ServiceStateChangeEvent illustration"
:domain "Commercial"
:eventId "40c3-a3a0-2379e9894a7d"
:eventTime "2022-08-25T12:19:28.538Z"
:eventType "ServiceStateChangeEvent"
:priority "3"
:timeOcurred "2022-08-25T12:19:25.724Z"
:title "ServiceStateChangeEvent"
:event {:service {:href "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351"
:id "5351"
:@type "Service"
:state "active"}}
:reportingSystem {:id "427"
:name "APP-755"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:source {:id "149"
:name "APP-78"
:@type "ReportingResource"
:@referredType "LogicalResource"}
:@baseType "Event"
:@type "ServiceStateChangeEvent"}})
require "http/client"
url = "{{baseUrl}}/listener/serviceStateChangeEvent"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/listener/serviceStateChangeEvent"),
Content = new StringContent("{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/listener/serviceStateChangeEvent");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/listener/serviceStateChangeEvent"
payload := strings.NewReader("{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/listener/serviceStateChangeEvent HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 873
{
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/listener/serviceStateChangeEvent")
.setHeader("content-type", "application/json")
.setBody("{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/listener/serviceStateChangeEvent"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/listener/serviceStateChangeEvent")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/listener/serviceStateChangeEvent")
.header("content-type", "application/json")
.body("{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}")
.asString();
const data = JSON.stringify({
correlationId: '9b374459-e9b0',
description: 'ServiceStateChangeEvent illustration',
domain: 'Commercial',
eventId: '40c3-a3a0-2379e9894a7d',
eventTime: '2022-08-25T12:19:28.538Z',
eventType: 'ServiceStateChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:25.724Z',
title: 'ServiceStateChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
state: 'active'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceStateChangeEvent'
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/listener/serviceStateChangeEvent');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceStateChangeEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: '9b374459-e9b0',
description: 'ServiceStateChangeEvent illustration',
domain: 'Commercial',
eventId: '40c3-a3a0-2379e9894a7d',
eventTime: '2022-08-25T12:19:28.538Z',
eventType: 'ServiceStateChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:25.724Z',
title: 'ServiceStateChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
state: 'active'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceStateChangeEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/listener/serviceStateChangeEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"9b374459-e9b0","description":"ServiceStateChangeEvent illustration","domain":"Commercial","eventId":"40c3-a3a0-2379e9894a7d","eventTime":"2022-08-25T12:19:28.538Z","eventType":"ServiceStateChangeEvent","priority":"3","timeOcurred":"2022-08-25T12:19:25.724Z","title":"ServiceStateChangeEvent","event":{"service":{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","id":"5351","@type":"Service","state":"active"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceStateChangeEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/listener/serviceStateChangeEvent',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "correlationId": "9b374459-e9b0",\n "description": "ServiceStateChangeEvent illustration",\n "domain": "Commercial",\n "eventId": "40c3-a3a0-2379e9894a7d",\n "eventTime": "2022-08-25T12:19:28.538Z",\n "eventType": "ServiceStateChangeEvent",\n "priority": "3",\n "timeOcurred": "2022-08-25T12:19:25.724Z",\n "title": "ServiceStateChangeEvent",\n "event": {\n "service": {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "id": "5351",\n "@type": "Service",\n "state": "active"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceStateChangeEvent"\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/listener/serviceStateChangeEvent")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/listener/serviceStateChangeEvent',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
correlationId: '9b374459-e9b0',
description: 'ServiceStateChangeEvent illustration',
domain: 'Commercial',
eventId: '40c3-a3a0-2379e9894a7d',
eventTime: '2022-08-25T12:19:28.538Z',
eventType: 'ServiceStateChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:25.724Z',
title: 'ServiceStateChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
state: 'active'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceStateChangeEvent'
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceStateChangeEvent',
headers: {'content-type': 'application/json'},
body: {
correlationId: '9b374459-e9b0',
description: 'ServiceStateChangeEvent illustration',
domain: 'Commercial',
eventId: '40c3-a3a0-2379e9894a7d',
eventTime: '2022-08-25T12:19:28.538Z',
eventType: 'ServiceStateChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:25.724Z',
title: 'ServiceStateChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
state: 'active'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceStateChangeEvent'
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/listener/serviceStateChangeEvent');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
correlationId: '9b374459-e9b0',
description: 'ServiceStateChangeEvent illustration',
domain: 'Commercial',
eventId: '40c3-a3a0-2379e9894a7d',
eventTime: '2022-08-25T12:19:28.538Z',
eventType: 'ServiceStateChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:25.724Z',
title: 'ServiceStateChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
state: 'active'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceStateChangeEvent'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/listener/serviceStateChangeEvent',
headers: {'content-type': 'application/json'},
data: {
correlationId: '9b374459-e9b0',
description: 'ServiceStateChangeEvent illustration',
domain: 'Commercial',
eventId: '40c3-a3a0-2379e9894a7d',
eventTime: '2022-08-25T12:19:28.538Z',
eventType: 'ServiceStateChangeEvent',
priority: '3',
timeOcurred: '2022-08-25T12:19:25.724Z',
title: 'ServiceStateChangeEvent',
event: {
service: {
href: 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
id: '5351',
'@type': 'Service',
state: 'active'
}
},
reportingSystem: {
id: '427',
name: 'APP-755',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
source: {
id: '149',
name: 'APP-78',
'@type': 'ReportingResource',
'@referredType': 'LogicalResource'
},
'@baseType': 'Event',
'@type': 'ServiceStateChangeEvent'
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/listener/serviceStateChangeEvent';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"correlationId":"9b374459-e9b0","description":"ServiceStateChangeEvent illustration","domain":"Commercial","eventId":"40c3-a3a0-2379e9894a7d","eventTime":"2022-08-25T12:19:28.538Z","eventType":"ServiceStateChangeEvent","priority":"3","timeOcurred":"2022-08-25T12:19:25.724Z","title":"ServiceStateChangeEvent","event":{"service":{"href":"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351","id":"5351","@type":"Service","state":"active"}},"reportingSystem":{"id":"427","name":"APP-755","@type":"ReportingResource","@referredType":"LogicalResource"},"source":{"id":"149","name":"APP-78","@type":"ReportingResource","@referredType":"LogicalResource"},"@baseType":"Event","@type":"ServiceStateChangeEvent"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"correlationId": @"9b374459-e9b0",
@"description": @"ServiceStateChangeEvent illustration",
@"domain": @"Commercial",
@"eventId": @"40c3-a3a0-2379e9894a7d",
@"eventTime": @"2022-08-25T12:19:28.538Z",
@"eventType": @"ServiceStateChangeEvent",
@"priority": @"3",
@"timeOcurred": @"2022-08-25T12:19:25.724Z",
@"title": @"ServiceStateChangeEvent",
@"event": @{ @"service": @{ @"href": @"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351", @"id": @"5351", @"@type": @"Service", @"state": @"active" } },
@"reportingSystem": @{ @"id": @"427", @"name": @"APP-755", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"source": @{ @"id": @"149", @"name": @"APP-78", @"@type": @"ReportingResource", @"@referredType": @"LogicalResource" },
@"@baseType": @"Event",
@"@type": @"ServiceStateChangeEvent" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/listener/serviceStateChangeEvent"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/listener/serviceStateChangeEvent" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/listener/serviceStateChangeEvent",
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([
'correlationId' => '9b374459-e9b0',
'description' => 'ServiceStateChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '40c3-a3a0-2379e9894a7d',
'eventTime' => '2022-08-25T12:19:28.538Z',
'eventType' => 'ServiceStateChangeEvent',
'priority' => '3',
'timeOcurred' => '2022-08-25T12:19:25.724Z',
'title' => 'ServiceStateChangeEvent',
'event' => [
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'id' => '5351',
'@type' => 'Service',
'state' => 'active'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceStateChangeEvent'
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/listener/serviceStateChangeEvent', [
'body' => '{
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/listener/serviceStateChangeEvent');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'correlationId' => '9b374459-e9b0',
'description' => 'ServiceStateChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '40c3-a3a0-2379e9894a7d',
'eventTime' => '2022-08-25T12:19:28.538Z',
'eventType' => 'ServiceStateChangeEvent',
'priority' => '3',
'timeOcurred' => '2022-08-25T12:19:25.724Z',
'title' => 'ServiceStateChangeEvent',
'event' => [
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'id' => '5351',
'@type' => 'Service',
'state' => 'active'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceStateChangeEvent'
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'correlationId' => '9b374459-e9b0',
'description' => 'ServiceStateChangeEvent illustration',
'domain' => 'Commercial',
'eventId' => '40c3-a3a0-2379e9894a7d',
'eventTime' => '2022-08-25T12:19:28.538Z',
'eventType' => 'ServiceStateChangeEvent',
'priority' => '3',
'timeOcurred' => '2022-08-25T12:19:25.724Z',
'title' => 'ServiceStateChangeEvent',
'event' => [
'service' => [
'href' => 'https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351',
'id' => '5351',
'@type' => 'Service',
'state' => 'active'
]
],
'reportingSystem' => [
'id' => '427',
'name' => 'APP-755',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'source' => [
'id' => '149',
'name' => 'APP-78',
'@type' => 'ReportingResource',
'@referredType' => 'LogicalResource'
],
'@baseType' => 'Event',
'@type' => 'ServiceStateChangeEvent'
]));
$request->setRequestUrl('{{baseUrl}}/listener/serviceStateChangeEvent');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/listener/serviceStateChangeEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/listener/serviceStateChangeEvent' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/listener/serviceStateChangeEvent", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/listener/serviceStateChangeEvent"
payload = {
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": { "service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
} },
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/listener/serviceStateChangeEvent"
payload <- "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/listener/serviceStateChangeEvent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/listener/serviceStateChangeEvent') do |req|
req.body = "{\n \"correlationId\": \"9b374459-e9b0\",\n \"description\": \"ServiceStateChangeEvent illustration\",\n \"domain\": \"Commercial\",\n \"eventId\": \"40c3-a3a0-2379e9894a7d\",\n \"eventTime\": \"2022-08-25T12:19:28.538Z\",\n \"eventType\": \"ServiceStateChangeEvent\",\n \"priority\": \"3\",\n \"timeOcurred\": \"2022-08-25T12:19:25.724Z\",\n \"title\": \"ServiceStateChangeEvent\",\n \"event\": {\n \"service\": {\n \"href\": \"https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351\",\n \"id\": \"5351\",\n \"@type\": \"Service\",\n \"state\": \"active\"\n }\n },\n \"reportingSystem\": {\n \"id\": \"427\",\n \"name\": \"APP-755\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"source\": {\n \"id\": \"149\",\n \"name\": \"APP-78\",\n \"@type\": \"ReportingResource\",\n \"@referredType\": \"LogicalResource\"\n },\n \"@baseType\": \"Event\",\n \"@type\": \"ServiceStateChangeEvent\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/listener/serviceStateChangeEvent";
let payload = json!({
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": json!({"service": json!({
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
})}),
"reportingSystem": json!({
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"source": json!({
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
}),
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/listener/serviceStateChangeEvent \
--header 'content-type: application/json' \
--data '{
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
}'
echo '{
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": {
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
}
},
"reportingSystem": {
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"source": {
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
},
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
}' | \
http POST {{baseUrl}}/listener/serviceStateChangeEvent \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "correlationId": "9b374459-e9b0",\n "description": "ServiceStateChangeEvent illustration",\n "domain": "Commercial",\n "eventId": "40c3-a3a0-2379e9894a7d",\n "eventTime": "2022-08-25T12:19:28.538Z",\n "eventType": "ServiceStateChangeEvent",\n "priority": "3",\n "timeOcurred": "2022-08-25T12:19:25.724Z",\n "title": "ServiceStateChangeEvent",\n "event": {\n "service": {\n "href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",\n "id": "5351",\n "@type": "Service",\n "state": "active"\n }\n },\n "reportingSystem": {\n "id": "427",\n "name": "APP-755",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "source": {\n "id": "149",\n "name": "APP-78",\n "@type": "ReportingResource",\n "@referredType": "LogicalResource"\n },\n "@baseType": "Event",\n "@type": "ServiceStateChangeEvent"\n}' \
--output-document \
- {{baseUrl}}/listener/serviceStateChangeEvent
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"correlationId": "9b374459-e9b0",
"description": "ServiceStateChangeEvent illustration",
"domain": "Commercial",
"eventId": "40c3-a3a0-2379e9894a7d",
"eventTime": "2022-08-25T12:19:28.538Z",
"eventType": "ServiceStateChangeEvent",
"priority": "3",
"timeOcurred": "2022-08-25T12:19:25.724Z",
"title": "ServiceStateChangeEvent",
"event": ["service": [
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"id": "5351",
"@type": "Service",
"state": "active"
]],
"reportingSystem": [
"id": "427",
"name": "APP-755",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"source": [
"id": "149",
"name": "APP-78",
"@type": "ReportingResource",
"@referredType": "LogicalResource"
],
"@baseType": "Event",
"@type": "ServiceStateChangeEvent"
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/listener/serviceStateChangeEvent")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
Creates a Service
{{baseUrl}}/service
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/service");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/service")
require "http/client"
url = "{{baseUrl}}/service"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/service"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/service");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/service"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/service HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/service")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/service"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/service")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/service")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/service');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/service'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/service';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/service',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/service")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/service',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/service'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/service');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/service'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/service';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/service"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/service" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/service",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/service');
echo $response->getBody();
setUrl('{{baseUrl}}/service');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/service');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/service' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/service' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("POST", "/baseUrl/service", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/service"
payload = ""
response = requests.post(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/service"
payload <- ""
response <- VERB("POST", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/service")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/service') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/service";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/service
http POST {{baseUrl}}/service
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/service
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/service")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"serviceDate": "2018-01-15T12:26:11.747Z",
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteristic": [
{
"id": "45gh-fg",
"name": "isCapped",
"value": true,
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "https://mycsp.com:8080/tmf-api/schema/VCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingResource": [
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed for a rock star.",
"@type": "Note"
}
],
"@type": "Service"
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"serviceDate": "2018-01-15T12:26:11.747Z",
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingResource": [
{
"id": "7171",
"href": "https://mycsp.com:8080/tmf-api/resourceInventoryManagement/v5/resource/7171",
"name": "BNG_MUX",
"value": "01 25 65",
"@type": "ResourceRef",
"@referredType": "VNF"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"intent": {
"@type": "Intent",
"id": "42",
"description": "Intent for ordering live broadcast service for an event",
"validFor": {
"startDateTime": "2022-10-23T00:30:00.000Z",
"endDateTime": "2022-10-19T23:30:00.000Z"
},
"isBundle": true,
"version": "1.0.0",
"intentSpecification": {
"@type": "IntentSpecificationRef",
"id": "EventLiveBroadcast_IntentSpec",
"name": "EventLiveBroadcastIntentSpec",
"@referredType": "IntentSpecification",
"@href": "/intent/v5/IntentSpecification/EventLiveBroadcast_IntentSpec"
},
"name": "EventLiveBroadcast",
"expression": {
"@type": "JsonLdExpression",
"expressionValue": {
"@context": {
"icm": "http://www.models.tmforum.org/tio/v1.0.0/IntentCommonModel#",
"cat": "http://www.operator.com/Catalog#",
"idan": "http://www.idan-tmforum-catalyst.org/IntentDrivenAutonomousNetworks#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"t": "http://www.w3.org/2006/time#",
"elb": "http://www.operator.com/Catalog/EventWirelessAccess#",
"app": "http://www.operator.com/Catalog/StreamingApplication#",
"geo": "https://tmforum.org/2020/07/geographicPoint#"
},
"idan:EventLiveBroadcast000001": {
"@type": "icm:Intent",
"icm:intentOwner": "idan:Salesforce",
"icm:hasExpectation": {
"idan:Delivery_service": {
"@type": "icm:DeliveryExpectation",
"icm:target": "_:service",
"icm:params": {
"icm:targetDescription": "cat:EventWirelessAccess"
}
},
"idan:Delivery_app": {
"@type": "icm:DeliveryExpectation",
"icm:target": "_:application",
"icm:params": {
"icm:targetDescription": "cat:StreamingApplication"
}
},
"idan:Property_service": {
"@type": "icm:PropertyExpectation",
"icm:target": "_:service",
"icm:params": {
"elb:serviceQuality": [
{
"icm:value": "4KUHD"
}
],
"elb:numberOfParticipants": [
{
"icm:atMost": "200"
}
],
"elb:areaOfService": [
{
"geo:geographicPoints": [
{
"geo:longitude": 90,
"geo:latitude": 44,
"geo:altitude": 84
},
{
"geo:longitude": 84,
"geo:latitude": -12,
"geo:altitude": 24
},
{
"geo:longitude": 131,
"geo:latitude": -36,
"geo:altitude": 29
},
{
"geo:longitude": 7,
"geo:latitude": 81,
"geo:altitude": -42
}
]
}
]
}
},
"idan:Property_app": {
"@type": "icm:PropertyExpectation",
"icm:target": "_:application",
"icm:params": {
"app:appType": [
{
"icm:value": "AWS MediaLive"
},
{
"icm:value": "Facebook Live"
},
{
"icm:value": "YouTube"
}
]
}
},
"idan:Reporting": {
"@type": "icm:ReportingExpectation",
"icm:target": "idan:EventLiveBroadcast",
"icm:params": {
"icm:reportingInterval": [
{
"t:Duration": [
{
"t:numbericDuration": 10,
"t:temporalUnit": "unitMinute"
}
]
}
],
"icm:reportingEvent": [
"icm:StateComplies",
"icm:StateDegrades"
]
}
}
}
}
}
},
"lifecycleStatus": "Active",
"creationDate": "2023-03-09T08:42:33.044Z",
"lastUpdate": "2023-03-09T08:42:33.044Z"
},
"@type": "Service"
}
DELETE
Deletes a Service
{{baseUrl}}/service/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/service/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/service/:id")
require "http/client"
url = "{{baseUrl}}/service/:id"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/service/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/service/:id");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/service/:id"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/service/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/service/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/service/:id"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/service/:id")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/service/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/service/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/service/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/service/:id';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/service/:id',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/service/:id")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/service/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/service/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/service/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/service/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/service/:id';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/service/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/service/:id" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/service/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/service/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/service/:id');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/service/:id');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/service/:id' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/service/:id' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/service/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/service/:id"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/service/:id"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/service/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/service/:id') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/service/:id";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/service/:id
http DELETE {{baseUrl}}/service/:id
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/service/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/service/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
List or find Service objects
{{baseUrl}}/service
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/service");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/service")
require "http/client"
url = "{{baseUrl}}/service"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/service"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/service");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/service"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/service HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/service")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/service"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/service")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/service")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/service');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/service'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/service';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/service',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/service")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/service',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/service'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/service');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/service'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/service';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/service"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/service" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/service",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/service');
echo $response->getBody();
setUrl('{{baseUrl}}/service');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/service');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/service' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/service' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/service")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/service"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/service"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/service")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/service') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/service";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/service
http GET {{baseUrl}}/service
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/service
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/service")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[
{
"id": "5351",
"name": "vCPE serial 1355615",
"state": "active",
"@type": "Service"
},
{
"id": "5352",
"name": "vDPI serial 1355445",
"state": "active",
"@type": "Service"
}
]
GET
Retrieves a Service by ID
{{baseUrl}}/service/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/service/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/service/:id")
require "http/client"
url = "{{baseUrl}}/service/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/service/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/service/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/service/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/service/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/service/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/service/:id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/service/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/service/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/service/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/service/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/service/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/service/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/service/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/service/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/service/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/service/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/service/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/service/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/service/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/service/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/service/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/service/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/service/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/service/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/service/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/service/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/service/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/service/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/service/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/service/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/service/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/service/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/service/:id
http GET {{baseUrl}}/service/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/service/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/service/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "active",
"category": "CFS",
"isServiceEnabled": true,
"hasStarted": true,
"startMode": "1",
"isStateful": true,
"serviceDate": "2018-01-15T12:26:11.747Z",
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"feature": [
{
"id": "Feat1",
"isEnabled": true,
"name": "ElasticBandwith",
"featureCharacteritic": [
{
"id": "45gh-fg",
"name": "isCapped",
"value": true,
"valueType": "boolean",
"@type": "BooleanCharacteristic"
}
],
"@type": "Feature"
}
],
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://my.schemas/VCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5885",
"id": "5885",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrdering/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
PATCH
Updates partially a Service
{{baseUrl}}/service/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/service/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/service/:id")
require "http/client"
url = "{{baseUrl}}/service/:id"
response = HTTP::Client.patch url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/service/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/service/:id");
var request = new RestRequest("", Method.Patch);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/service/:id"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/service/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/service/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/service/:id"))
.method("PATCH", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/service/:id")
.patch(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/service/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/service/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'PATCH', url: '{{baseUrl}}/service/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/service/:id';
const options = {method: 'PATCH'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/service/:id',
method: 'PATCH',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/service/:id")
.patch(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/service/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'PATCH', url: '{{baseUrl}}/service/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/service/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'PATCH', url: '{{baseUrl}}/service/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/service/:id';
const options = {method: 'PATCH'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/service/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/service/:id" in
Client.call `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/service/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/service/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/service/:id');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/service/:id');
$request->setRequestMethod('PATCH');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/service/:id' -Method PATCH
$response = Invoke-RestMethod -Uri '{{baseUrl}}/service/:id' -Method PATCH
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = ""
conn.request("PATCH", "/baseUrl/service/:id", payload)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/service/:id"
payload = ""
response = requests.patch(url, data=payload)
print(response.json())
library(httr)
url <- "{{baseUrl}}/service/:id"
payload <- ""
response <- VERB("PATCH", url, body = payload, content_type(""))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/service/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.patch('/baseUrl/service/:id') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/service/:id";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/service/:id
http PATCH {{baseUrl}}/service/:id
wget --quiet \
--method PATCH \
--output-document \
- {{baseUrl}}/service/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/service/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/merge-patch+json
RESPONSE BODY text
{
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "inactive",
"category": "CFS",
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://host:port/schema/VCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/6500",
"id": "6500",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrdering/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
RESPONSE HEADERS
Content-Type
application/json-patch+json
RESPONSE BODY json
{
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "inactive",
"category": "CFS",
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://host:port/schema/VCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/6500",
"id": "6500",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrdering/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}
RESPONSE HEADERS
Content-Type
application/json-patch-query+json
RESPONSE BODY json
{
"id": "5351",
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5351",
"serviceType": "Cloud",
"name": "vCPE serial 1355615",
"description": "Instantiation of vCPE",
"state": "inactive",
"category": "CFS",
"startDate": "2018-01-15T12:26:11.747Z",
"serviceSpecification": {
"id": "1212",
"href": "https://mycsp.com:8080/tmf-api/serviceCatalogManagement/v5/serviceSpecification/1212",
"name": "vCPE",
"version": "1.0.0",
"@type": "ServiceSpecificationRef",
"@referredType": "ServiceSpecification"
},
"serviceCharacteristic": [
{
"id": "452-gh6",
"name": "vCPE",
"valueType": "object",
"value": {
"@type": "VCPE",
"@schemaLocation": "http://host:port/schema/VCPE.schema.json",
"vCPE_IP": "193.218.236.21",
"MaxTxRate": 300,
"TransmitPower": "11 dBm",
"maxTream": "OFF"
},
"@type": "ObjectCharacteristic"
}
],
"serviceRelationship": [
{
"relationshipType": "DependentOn",
"ServiceRelationshipCharacteristic": [
{
"id": "126",
"name": "CrossRef",
"value": "44-11-h",
"valueType": "string",
"@type": "StringCharacteristic"
}
],
"service": {
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/5645",
"id": "5645",
"@type": "ServiceRef",
"@referredType": "Service"
},
"@type": "ServiceRelationship"
}
],
"supportingService": [
{
"href": "https://mycsp.com:8080/tmf-api/serviceInventory/v5/service/6500",
"id": "6500",
"@type": "ServiceRef",
"@referredType": "Service"
}
],
"relatedParty": [
{
"role": "user",
"partyOrPartyRole": {
"href": "https://mycsp.com:8080/tmf-api/partyManagement/v5/individual/456",
"id": "456",
"name": "John Doe",
"@type": "PartyRef",
"@referredType": "Individual"
},
"@type": "RelatedPartyRefOrPartyRoleRef"
}
],
"serviceOrderItem": [
{
"serviceOrderHref": "https://mycsp.com:8080/tmf-api/serviceOrdering/v5/serviceOrder/42",
"serviceOrderId": "42",
"role": "initiator",
"@referredType": "ServiceOrderItem",
"@type": "RelatedServiceOrderItem",
"itemId": "1",
"itemAction": "add"
}
],
"place": [
{
"role": "InstallationAddress",
"place": {
"href": "https://mycsp.com:8080/tmf-api/geographicAddressManagement/v5/geographicAddress/2435",
"id": "2435",
"name": "Customer primary location",
"@type": "PlaceRef",
"@referredType": "GeographicAddress"
},
"@type": "RelatedPlaceRefOrValue"
}
],
"note": [
{
"id": "77456",
"author": "Harvey Poupon",
"date": "2018-01-15T12:26:11.748Z",
"text": "This service was installed automatically, no issues were noted in testing.",
"@type": "Note"
}
],
"@type": "Service"
}