orgsServicePolicies := client .OrgsServicePolicies ()
OrgsServicePolicies
Create Org Service Policy
Create Org Serrvice Policy
CreateOrgServicePolicy (
ctx context .Context ,
orgId uuid .UUID ,
body * models .OrgServicePolicy ) (
models .ApiResponse [models .OrgServicePolicy ],
error )
models.OrgServicePolicy
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.OrgServicePolicy {
Action : models .ToPointer (models .AllowDenyEnum ("allow" )),
Name : models .ToPointer ("string" ),
Services : []string {
"string" ,
},
Tenants : []string {
"string" ,
},
}
apiResponse , err := orgsServicePolicies .CreateOrgServicePolicy (ctx , orgId , & body )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
Delete Org Service Policy
Delete Org Service Policuy
DeleteOrgServicePolicy (
ctx context .Context ,
orgId uuid .UUID ,
servicepolicyId uuid .UUID ) (
http .Response ,
error )
Parameter
Type
Tags
Description
orgId
uuid.UUID
Template, Required
-
servicepolicyId
uuid.UUID
Template, Required
-
``
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
servicepolicyId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
resp , err := orgsServicePolicies .DeleteOrgServicePolicy (ctx , orgId , servicepolicyId )
if err != nil {
log .Fatalln (err )
} else {
fmt .Println (resp .StatusCode )
}
Get Org Service Policy Details
GetOrgServicePolicy (
ctx context .Context ,
orgId uuid .UUID ,
servicepolicyId uuid .UUID ) (
models .ApiResponse [models .OrgServicePolicy ],
error )
Parameter
Type
Tags
Description
orgId
uuid.UUID
Template, Required
-
servicepolicyId
uuid.UUID
Template, Required
-
models.OrgServicePolicy
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
servicepolicyId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
apiResponse , err := orgsServicePolicies .GetOrgServicePolicy (ctx , orgId , servicepolicyId )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}
List Org Service Policies
Get List of Org Service Policies
ListOrgServicePolicies (
ctx context .Context ,
orgId uuid .UUID ,
limit * int ,
page * int ) (
models.ApiResponse [[]models.OrgServicePolicy ],
error )
Parameter
Type
Tags
Description
orgId
uuid.UUID
Template, Required
-
limit
*int
Query, Optional
Default : 100
Constraints : >= 0
page
*int
Query, Optional
Default : 1
Constraints : >= 1
[]models.OrgServicePolicy
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
limit := 100
page := 1
apiResponse , err := orgsServicePolicies .ListOrgServicePolicies (ctx , orgId , & limit , & page )
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)
[
{
"action" : " allow" ,
"created_time" : 0 ,
"id" : " string" ,
"modified_time" : 0 ,
"name" : " string" ,
"org_id" : " string" ,
"services" : [
" string"
],
"tenants" : [
" string"
]
}
]
Update Org Service Policy
Update Org Serrvice Policy
UpdateOrgServicePolicy (
ctx context .Context ,
orgId uuid .UUID ,
servicepolicyId uuid .UUID ,
body * models .OrgServicePolicy ) (
models .ApiResponse [models .OrgServicePolicy ],
error )
Parameter
Type
Tags
Description
orgId
uuid.UUID
Template, Required
-
servicepolicyId
uuid.UUID
Template, Required
-
body
*models.OrgServicePolicy
Body, Optional
-
models.OrgServicePolicy
ctx := context .Background ()
orgId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
servicepolicyId := uuid .MustParse ("000000ab-00ab-00ab-00ab-0000000000ab" )
body := models.OrgServicePolicy {
Action : models .ToPointer (models .AllowDenyEnum ("allow" )),
Name : models .ToPointer ("string" ),
Services : []string {
"string" ,
},
Tenants : []string {
"string" ,
},
}
apiResponse , err := orgsServicePolicies .UpdateOrgServicePolicy (ctx , orgId , servicepolicyId , & body )
if err != nil {
log .Fatalln (err )
} else {
// Printing the result and response
fmt .Println (apiResponse .Data )
fmt .Println (apiResponse .Response .StatusCode )
}