예제 #1
0
파일: create.go 프로젝트: flazz/rack
func (command *commandCreate) Execute(resource *handler.Resource) {
	opts := resource.Params.(*paramsCreate).opts
	securityGroupRule, err := securityGroupRules.Create(command.Ctx.ServiceClient, *opts).Extract()
	if err != nil {
		resource.Err = err
		return
	}
	resource.Result = securityGroupRuleSingle(securityGroupRule)
}
예제 #2
0
func createSecRule(t *testing.T, groupID string) string {
	r, err := rsRules.Create(Client, osRules.CreateOpts{
		Direction:    "ingress",
		PortRangeMin: 80,
		EtherType:    "IPv4",
		PortRangeMax: 80,
		Protocol:     "tcp",
		SecGroupID:   groupID,
	}).Extract()

	th.AssertNoErr(t, err)

	t.Logf("Created security group rule %s", r.ID)

	return r.ID
}