createPolicy
To create A1 policies
/policies
Usage and SDK Samples
curl -X POST \
-H "Accept: application/json,application/problem+json" \
-H "Content-Type: application/json" \
"https://example.com/a1-policy-management/v1/policies" \
-d '{
"policyId" : "POLICY-ID",
"nearRtRicId" : "Near-RT-Ric-ID",
"transient" : false,
"policyObject" : "{}",
"serviceId" : "rApp ID",
"policyTypeId" : "ORAN_QOS_1.0.0(typeName_SemVersion)"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.A1PolicyManagementApi;
import java.io.File;
import java.util.*;
public class A1PolicyManagementApiExample {
public static void main(String[] args) {
// Create an instance of the API class
A1PolicyManagementApi apiInstance = new A1PolicyManagementApi();
PolicyObjectInformation policyObjectInformation = ; // PolicyObjectInformation |
try {
PolicyObjectInformation result = apiInstance.createPolicy(policyObjectInformation);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling A1PolicyManagementApi#createPolicy");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final PolicyObjectInformation policyObjectInformation = new PolicyObjectInformation(); // PolicyObjectInformation |
try {
final result = await api_instance.createPolicy(policyObjectInformation);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->createPolicy: $e\n');
}
import org.openapitools.client.api.A1PolicyManagementApi;
public class A1PolicyManagementApiExample {
public static void main(String[] args) {
A1PolicyManagementApi apiInstance = new A1PolicyManagementApi();
PolicyObjectInformation policyObjectInformation = ; // PolicyObjectInformation |
try {
PolicyObjectInformation result = apiInstance.createPolicy(policyObjectInformation);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling A1PolicyManagementApi#createPolicy");
e.printStackTrace();
}
}
}
// Create an instance of the API class
A1PolicyManagementApi *apiInstance = [[A1PolicyManagementApi alloc] init];
PolicyObjectInformation *policyObjectInformation = ; //
[apiInstance createPolicyWith:policyObjectInformation
completionHandler: ^(PolicyObjectInformation output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var A1PolicyManagementApi = require('a1_policy_management_api');
// Create an instance of the API class
var api = new A1PolicyManagementApi.A1PolicyManagementApi()
var policyObjectInformation = ; // {PolicyObjectInformation}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createPolicy(policyObjectInformation, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class createPolicyExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new A1PolicyManagementApi();
var policyObjectInformation = new PolicyObjectInformation(); // PolicyObjectInformation |
try {
PolicyObjectInformation result = apiInstance.createPolicy(policyObjectInformation);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling A1PolicyManagementApi.createPolicy: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\A1PolicyManagementApi();
$policyObjectInformation = ; // PolicyObjectInformation |
try {
$result = $api_instance->createPolicy($policyObjectInformation);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling A1PolicyManagementApi->createPolicy: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::A1PolicyManagementApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::A1PolicyManagementApi->new();
my $policyObjectInformation = WWW::OPenAPIClient::Object::PolicyObjectInformation->new(); # PolicyObjectInformation |
eval {
my $result = $api_instance->createPolicy(policyObjectInformation => $policyObjectInformation);
print Dumper($result);
};
if ($@) {
warn "Exception when calling A1PolicyManagementApi->createPolicy: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.A1PolicyManagementApi()
policyObjectInformation = # PolicyObjectInformation |
try:
api_response = api_instance.create_policy(policyObjectInformation)
pprint(api_response)
except ApiException as e:
print("Exception when calling A1PolicyManagementApi->createPolicy: %s\n" % e)
extern crate A1PolicyManagementApi;
pub fn main() {
let policyObjectInformation = ; // PolicyObjectInformation
let mut context = A1PolicyManagementApi::Context::default();
let result = client.createPolicy(policyObjectInformation, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
Name | Description |
---|---|
policyObjectInformation * |
Responses
Name | Type | Format | Description |
---|---|---|---|
Location | String | Contains the URI of the newly created resource |