// CreateFirewallAcl creates a new child FirewallAcl under the Enterprise
548037
func (o *Enterprise) CreateFirewallAcl(child *FirewallAcl) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
479461
func createFirewallRuleVm(envName string, machineId string, portRange network.IngressRule) string {
	ports := []string{}
	for p := portRange.FromPort; p <= portRange.ToPort; p++ {
		ports = append(ports, fmt.Sprintf("PORT %d", p))
	}
	var portList string
	if len(ports) > 1 {
		portList = fmt.Sprintf("( %s )", strings.Join(ports, " AND "))
	} else if len(ports) == 1 {
		portList = ports[0]
	}
	return fmt.Sprintf(firewallRuleVm, envName, machineId, strings.ToLower(portRange.Protocol), portList)
}
1212304
func (c *Client) CreateEgressFirewallRule(p *CreateEgressFirewallRuleParameter) (*FirewallRule, error) {
	obj, err := c.Request("createEgressFirewallRule", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*FirewallRule), err
}
1374453
func NewSetFirewallRuleCommand() cmd.Command {
	cmd := &setFirewallRuleCommand{}
	cmd.newAPIFunc = func() (SetFirewallRuleAPI, error) {
		root, err := cmd.NewAPIRoot()
		if err != nil {
			return nil, errors.Trace(err)
		}
		return firewallrules.NewClient(root), nil

	}
	return modelcmd.Wrap(cmd)
}
1318960
func createFirewallRuleAll(envName string, portRange network.IngressRule) string {
	ports := []string{}
	for p := portRange.FromPort; p <= portRange.ToPort; p++ {
		ports = append(ports, fmt.Sprintf("PORT %d", p))
	}
	var portList string
	if len(ports) > 1 {
		portList = fmt.Sprintf("( %s )", strings.Join(ports, " AND "))
	} else if len(ports) == 1 {
		portList = ports[0]
	}
	return fmt.Sprintf(firewallRuleAll, envName, strings.ToLower(portRange.Protocol), portList)
}
1240493
func (o *VirtualFirewallPolicy) CreateVirtualFirewallRule(child *VirtualFirewallRule) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
51970
func (o *VSP) CreateNetconfManager(child *NetconfManager) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
405205
func (o *Enterprise) FirewallRules(info *bambou.FetchingInfo) (FirewallRulesList, *bambou.Error) {

	var list FirewallRulesList
	err := bambou.CurrentSession().FetchChildren(o, FirewallRuleIdentity, &list, info)
	return list, err
}
1328586
func (o *Enterprise) CreateVNF(child *VNF) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
191681
func (c *Client) CreateSAMLConnector(connector services.SAMLConnector) error {
	data, err := services.GetSAMLConnectorMarshaler().MarshalSAMLConnector(connector)
	if err != nil {
		return trace.Wrap(err)
	}
	_, err = c.PostJSON(c.Endpoint("saml", "connectors"), &createSAMLConnectorRawReq{
		Connector: data,
	})
	if err != nil {
		return trace.Wrap(err)
	}
	return nil
}
504430
func (c Client) CreateBuild(ctx context.Context, build *buildv1.Build) error {
	_, err := c.Builds.Builds(apirequest.NamespaceValue(ctx)).Create(build)
	return err
}
993656
func (c *Client) ListFirewallRules() ([]params.FirewallRule, error) {
	var results params.ListFirewallRulesResults
	if err := c.facade.FacadeCall("ListFirewallRules", nil, &results); err != nil {
		return nil, errors.Trace(err)
	}
	return results.Rules, nil
}
1213137
func NewFirewallerFacade(apiCaller base.APICaller) (FirewallerAPI, error) {
	facade, err := firewaller.NewClient(apiCaller)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return facade, nil
}
747061
func (s *FirewallService) ConfigurePaloAltoFirewall(p *ConfigurePaloAltoFirewallParams) (*PaloAltoFirewallResponse, error) {
	resp, err := s.cs.newRequest("configurePaloAltoFirewall", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r PaloAltoFirewallResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		b, err = convertFirewallServiceResponse(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
435631
func (c *Client) ListFirewallRules(p *ListFirewallRulesParameter) ([]*FirewallRule, error) {
	obj, err := c.Request("listFirewallRules", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.([]*FirewallRule), err
}
970198
func NewFirewall(cfg environs.ConfigGetter, client FirewallerAPI, c clock.Clock) *Firewall {
	return &Firewall{
		environ: cfg,
		client:  client,
		clock:   c,
	}
}
335946
func (c *Client) UpdateFirewallRule(p *UpdateFirewallRuleParameter) (*FirewallRule, error) {
	obj, err := c.Request("updateFirewallRule", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*FirewallRule), err
}