orgsJSE := client .OrgsJSE ()
OrgsJSE
Delete Org Jsec Credential
Delete JSE credential
DeleteOrgJsecCredential (
ctx context .Context ,
orgId uuid .UUID ) (
http .Response ,
error )
Parameter
Type
Tags
Description
orgId
uuid.UUID
Template, Required
-
``
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
resp , err := orgsJSE .DeleteOrgJsecCredential (ctx , orgId )
if err != nil {
log .Fatalln (err )
} else {
fmt .Println (resp .StatusCode )
}
Retrieves the list of JSE orgs associated with the account.
GetOrgJseInfo (
ctx context .Context ,
orgId uuid .UUID ) (
models .ApiResponse [models .AccountJseInfo ],
error )
Parameter
Type
Tags
Description
orgId
uuid.UUID
Template, Required
-
models.AccountJseInfo
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
apiResponse , err := orgsJSE .GetOrgJseInfo (ctx , orgId )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Example Response (as JSON)
{
"cloud_name" : " devcentral.juniperclouds.net" ,
"org_names" : [
" Mist-Sys" ,
" Mist-Eng"
]
}
Get Org JSE Credential
GetOrgJsecCredential (
ctx context .Context ,
orgId uuid .UUID ) (
models .ApiResponse [models .AccountJseInfo ],
error )
Parameter
Type
Tags
Description
orgId
uuid.UUID
Template, Required
-
models.AccountJseInfo
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
apiResponse , err := orgsJSE .GetOrgJsecCredential (ctx , orgId )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Setup Org Jsec Credential
in JSE UI:
Create custom role with Read access to service_location and RW access to site and IPSec profile APIs.
Create a user with the above custom role. - email: john@abc.com
Activate the user in the JSE account.
Create the service locations on the JSE account.
SetupOrgJsecCredential (
ctx context .Context ,
orgId uuid .UUID ,
body * models .AccountJseConfig ) (
models .ApiResponse [models .AccountJseInfo ],
error )
models.AccountJseInfo
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.AccountJseConfig {
CloudName : models .ToPointer ("devcentral.juniperclouds.net" ),
Password : "foryoureyesonly" ,
Username : "john@abc.com" ,
}
apiResponse , err := orgsJSE .SetupOrgJsecCredential (ctx , orgId , & body )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}