示例#1
0
文件: create.go 项目: flazz/rack
func (command *commandCreate) Execute(resource *handler.Resource) {
	opts := resource.Params.(*paramsCreate).opts
	securityGroup, err := securityGroups.Create(command.Ctx.ServiceClient, *opts).Extract()
	if err != nil {
		resource.Err = err
		return
	}
	resource.Result = securityGroupSingle(securityGroup)
}
示例#2
0
func createSecGroup(t *testing.T) string {
	sg, err := rsGroups.Create(Client, osGroups.CreateOpts{
		Name:        "new-webservers",
		Description: "security group for webservers",
	}).Extract()

	th.AssertNoErr(t, err)

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

	return sg.ID
}