Hi Naga,
The first example you gave to create an ACO will not work due to the extra comma after the "Desc" value. Below example worked for me to create a basic ACO with no parameters:
POST https://{{host}}:8443/ca/api/sso/services/policy/v1/SmAgentConfigs/
{
"Name": "NagatestACO2",
"Desc": "REST API testing"
}
Next, to update the ACO with parameters, you'll need to perform a PUT to the correct URL which includes the ACO name:
PUT https://{{host}}:8443/ca/api/sso/services/policy/v1/SmAgentConfigs/NagatestACO2
{
"type": "SmAgentConfig",
"Name": "NagatestACO2",
"Attributes": [
"DefaultAgentName=2=Nagatest"
]
}
There are many more attributes that should be included in the ACO. I limited it only one for brevity. You'll notice the ACO parameters have either Parameter=0=value or Parameter=2=value. To my understanding, the =0= means it's a default unchanged value. =2= is a changed value.
To update the Agent Group, your URL and PUT method looks good, but you should remove all "id" and "href" from the JSON.
Example Agent Group creation without agents defined:
POST https://{{host}}:8443/ca/api/sso/services/policy/v1/SmAgentGroups
{
"type": "SmAgentGroup",
"Name": "NagaTestNew2",
"Desc": "Group of external Access Gateways",
"AgentTypeLink": {
"path": "/SmAgentTypes/Web+Agent",
"desc": "SiteMinder Web Agent"
},
"AgentsLink": [
]
}
Then update the Agent Group with agents:
PUT https://{{host}}:8443/ca/api/sso/services/policy/v1/SmAgentGroups/NagaTestNew2
{
"type": "SmAgentGroup",
"Name": "NagaTestNew2",
"Desc": "Group of external Access Gateways",
"AgentTypeLink": {
"path": "/SmAgentTypes/Web+Agent",
"desc": "SiteMinder Web Agent"
},
"AgentsLink": [
{
"path": "/SmAgents/accessgateway"
},
{
"path": "/SmAgents/accessgateway2"
}
]
}
Thanks,
Warren
Original Message:
Sent: Aug 24, 2022 11:14 AM
From: NAGARAJU REDDEPALLI
Subject: Re: Creating policy objects using Swagger Rest API
Hi Barrow,
I am able to create ACO using below syntax ( Hope this will help others so adding syntax below):
{
"Name": "NagatestACO2",
"Desc": "REST API testing",
}
Able to create new AgentGroup and add existing agent using below syntax:
{
"type": "SmAgentGroup",
"Name": "NagaTestNew2",
"Desc": "REST API testing",
"AgentTypeLink": {
"path": "/SmAgentTypes/Web+Agent",
"desc": "SiteMinder Web Agent"
},
"AgentsLink": [{
"path": "/SmAgents/nagatest3"
}]
}
My Question is to make it clear:
1. I want to add AgentName or any other parameter to the existing ACO( I will get the details of existing ACO using GET request) how can I mention in the json syntax? and the request method to use, is it PUT? if yes then what is the URL I need to use?
2. I want to add Agent to existing AgentGroup, I tried using PUT method but didn't worked getting 403 forbidden
URL: https://xyz.com/ca/api/sso/services/policy/v1/SmAgentGroups/NagaTestNew2
method: PUT
json syntax:
{
"id": "CA.SM::AgentGroup@02-00007180-0523-1306-8c91-93ad0f830000",
"path": "/SmAgentGroups/NagaTestNew2",
"href": "https://abc.com:8443/ca/api/sso/services/policy/v1/objects/CA.SM::AgentGroup@02-00007180-0523-1306-8c91-93ad0f830000",
"desc": "REST API testing",
"AgentTypeLink": {
"path": "/SmAgentTypes/Web+Agent",
"desc": "SiteMinder Web Agent"
},
"AgentsLink": [{
"id": "CA.SM::Agent@01-00059459-b11a-1304-8c91-93ad0f830000",
"path": "/SmAgents/nagatest3",
"href": "https://abc.com:8443/ca/api/sso/services/policy/v1/objects/CA.SM::Agent@01-00059459-b11a-1304-8c91-93ad0f830000"
}]
}
Error:
<p>Access to the resource or application <b>/ca/api/sso/services/policy/v1/SmAgentGroups/NagaTestNew2</b> is
forbidden. You may be using an incorrect URL.</p>
<p>If you are using the URL supplied to you, please contact the Helpdesk and report the issue.</p>
Currently I am facing these 2 issues, I am really struggling to get the proper json syntax which is not mentioned in the documentation. I am tired of searching but didn't get any info related to this.
Wondering whether anyone tried or implemented using REST API for all policy objects via POSTMAN because didn't get any information related to it.
Hope you can help on this.
Thanks,
Naga
Original Message:
Sent: Aug 24, 2022 01:12 AM
From: NAGARAJU REDDEPALLI
Subject: Re: Creating policy objects using Swagger Rest API
Hi Barrow,
Thanks for the Response :)
But my requirement is I want to add AgentName parameter to the exisiting or newly created ACO, how it can be done? not only AgentName parameter if I want to add any parameter to the existing ACO or adding a parameter for newly created one, what is the syntax for it?
Example I am using it, but getting error seems incorrect syntax.
{
"Name": "NagatestACO",
"Desc": "REST API testing",
"Attributes": [{
"Name": "AgentName",
"Value": "nagatest,xyz.com"
}]
}
I am using POSTMAN and using POST method for above. But to add a new parameter for existing ACO, then I need to perform a GET to get the info of the ACO like id,path, href to which we need to add a AgentName or modify any parameter and perform a PUT method to include the parameter we need to add is that correct?
Thanks,
Naga
Original Message:
Sent: Aug 23, 2022 05:45 PM
From: Warren Barrow
Subject: Re: Creating policy objects using Swagger Rest API
Hi Naga,
The best approach is to perform a GET request on an existing object, copy the response payload, provide a new name for the object, and remove the unnecessary detail. I used Postman to perform the interaction which provided a quick way to test the validity of the POST request. For the Agent Group creation, I removed the "responseType", an "id", "href" from each section, and everything within "links". I think you'll find most objects require only a small amount of elements to be created.
Yes, you can POST to SmAgentConfigs to create a new ACO object which defines the DefaultAgentName parameter.
Thanks,
Warren
Original Message:
Sent: Aug 23, 2022 05:27 AM
From: NAGARAJU REDDEPALLI
Subject: Re: Creating policy objects using Swagger Rest API
Hi Barrow,
That works. Thank you.
Could you able to provide me the json syntax for creating Realm, rules, responses and Authschemes? I am testing using the syntax in REST API doc but unable to make it work not sure how to use it and unable to get the exact syntax for it.
And also I am trying to add webagent to ACO using JSON syntax, may i know how it can be done?
If possible could you please try to explain how to use JSON syntax for remaining policy objects that will be more helpful.
Thanks,
Naga
Original Message:
Sent: Aug 22, 2022 04:06 PM
From: Warren Barrow
Subject: Re: Creating policy objects using Swagger Rest API
Hi Naga,
Here's an example JSON body to use when creating a SiteMinder Agent Group.
The parameters you should modify are: Name, Desc, and AgentsLink path (for each agent being added).
{ "type": "SmAgentGroup", "Name": "Access Gateway Group", "Desc": "Group of external Access Gateways", "AgentTypeLink": { "path": "/SmAgentTypes/Web+Agent", "desc": "SiteMinder Web Agent" }, "AgentsLink": [ { "path": "/SmAgents/accessgateway" }, { "path": "/SmAgents/accessgateway2" } ] }
Original Message:
Sent: Aug 19, 2022 06:48 AM
From: NAGARAJU REDDEPALLI
Subject: Re: Creating policy objects using Swagger Rest API
Hi Barrow,
Thanks for the response. I am going through the rest API documentation and the syntaxes provided in Adminui. But trying to create Agent group based on the jason syntax provided below:
{ "Name": "string", "Desc": "string", "AgentTypeLink": { "id": "string", "path": "string", "href": "string", "desc": "string" }, "AgentsLink": [ { "id": "string", "path": "string", "href": "string", "desc": "string" } ], "AgentGroupsLink": [ { "id": "string", "path": "string", "href": "string", "desc": "string" } ]}
I am trying to create but it is giving error as I know it is not the correct syntax I am using. So that's where I am struck how to use those values which is mentioned above, because I need to create rules, responses, Authschemes.
Could you please elaborate it?
Thanks,
Naga
Original Message:
Sent: Aug 18, 2022 04:34 PM
From: Warren Barrow
Subject: Re: Creating policy objects using Swagger Rest API
Hi Naga,
In addition to the documentation, we provide a SiteMinder REST API doc interface that is linked within the SiteMinder Admin UI. The URL will be https://<sm-adminui-server>:8443/ca/api/sso/services/v1/api-doc/ ... In this API doc you'll find examples of the methods and syntax required.
Also, one of our Solution Engineers has provided a REST API shell script framework that you may find useful. https://community.broadcom.com/enterprisesoftware/viewdocument/siteminder-restapi-shell-script-fra?CommunityKey=f9d65308-ca9b-48b7-915c-7e9cb8fc3295&tab=librarydocuments
Original Message:
Sent: Aug 15, 2022 08:27 AM
From: NAGARAJU REDDEPALLI
Subject: Re: Creating policy objects using Swagger Rest API
Hello,
I see only for agent creation it is mentioned in 12.8 documentation but for creation of other policy objects like agent group, adding agent to agent group, auth scheme, rules and responses.
It's really becoming very hard to find json syntax and testing based on GET request for all policy objects.
Please provide the syntax for all policy objects and is there any clear cut documentation.
Thanks,
Naga
Original Message:
Sent: Aug 28, 2017 12:38 PM
From: Ujwol Shrestha
Subject: Re: Creating policy objects using Swagger Rest API
To identify path, you can perform GET request first for that object.
They all however follow the pattern. So once you know the pattern you can always guess them.