Authorize Ingress Rule
(self, apiclient, services,
account=None, domainid=None, projectid=None)
| 4511 | apiclient.deleteSecurityGroup(cmd) |
| 4512 | |
| 4513 | def authorize(self, apiclient, services, |
| 4514 | account=None, domainid=None, projectid=None): |
| 4515 | """Authorize Ingress Rule""" |
| 4516 | |
| 4517 | cmd = authorizeSecurityGroupIngress.authorizeSecurityGroupIngressCmd() |
| 4518 | |
| 4519 | if domainid: |
| 4520 | cmd.domainid = domainid |
| 4521 | if account: |
| 4522 | cmd.account = account |
| 4523 | |
| 4524 | if projectid: |
| 4525 | cmd.projectid = projectid |
| 4526 | cmd.securitygroupid = self.id |
| 4527 | cmd.protocol = services["protocol"] |
| 4528 | |
| 4529 | if services["protocol"] == 'ICMP': |
| 4530 | cmd.icmptype = -1 |
| 4531 | cmd.icmpcode = -1 |
| 4532 | else: |
| 4533 | cmd.startport = services["startport"] |
| 4534 | cmd.endport = services["endport"] |
| 4535 | |
| 4536 | cmd.cidrlist = services["cidrlist"] |
| 4537 | return (apiclient.authorizeSecurityGroupIngress(cmd).__dict__) |
| 4538 | |
| 4539 | def revoke(self, apiclient, id): |
| 4540 | """Revoke ingress rule""" |