Policy sets provide a means to attach policies globally to a range of endpoints of the same type.
CREATING A POLICY SET USINg WLST
CreatePolicySet.py
import os
propInputStream = FileInputStream("PolicySets.properties")
configProps = Properties()
configProps.load(propInputStream)
connect(configProps.get("userName"),configProps.get("passWord"),'t3://'+configProps.get("wlsHost")+':'+configProps.get("adminServerListenPort"))
splits=String(configProps.get("policysets_to_be_created")).split(",")
for dsIndex in splits:
beginRepositorySession()
#Variable Definitions
policySetName=configProps.get("policySetName_"+ str(dsIndex))
policySetType=configProps.get("policySetType_"+ str(dsIndex))
policySetAttachTo=configProps.get("policySetAttachTo_"+ str(dsIndex))
policySetDescription=configProps.get("policySetDescription_"+ str(dsIndex))
policySetEnabled=configProps.get("policySetEnabled_"+ str(dsIndex))
policySetUrl=configProps.get("policySetUrl_"+ str(dsIndex))
print "Creating Policy Sets for System Resource Name:"+policySetName
+ ", Policy Set Type:" + policySetType +" Attached To: "+
policySetAttachTo + " , Description:" + policySetDescription + ",
Enabled true or false: "+ policySetEnabled
createPolicySet(policySetName,policySetType,policySetAttachTo,description=policySetDescription,enable=policySetEnabled)
print "Attaching Policy Sets"
attachPolicySetPolicy(policySetUrl)
print "Commiting Session"
commitRepositorySession()
PolicySets.properties
userName=username
passWord=password
wlsHost=localhost
domainDir=domainDir
adminServerListenPort=7001
#Total Number of Data Sources
policysets_to_be_created=1
#Properties for the first PolicySets
policySetName_1=TestWSClientPolicySet
policySetType_1=sca-reference
policySetAttachTo_1=Domain("domain") and Server("server1") and Composite("*CBP*")
policySetDescription_1=Global policy attachments for SOA Reference resources.
policySetEnabled_1=true
policySetUrl_1=oracle/wss10_saml_token_client_policy_OPT_ON |
Saturday, June 23, 2012
Oracle Fusion Middleware Security for Web Services 11g Release 1 (11.1.1.6) Policy Sets using WLST
########
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment