// NetprofileDelete deletes netprofile
172382
func (ac *APIController) NetprofileDelete(netProfile *contivModel.Netprofile) error {
	log.Infof("Deleting Netprofile:%s", netProfile.ProfileName)

	// Find Tenant
	tenant := contivModel.FindTenant(netProfile.TenantName)
	if tenant == nil {
		return core.Errorf("Tenant %s not found", netProfile.TenantName)
	}
	// Check if any endpoint group is using the network policy
	if len(netProfile.LinkSets.EndpointGroups) != 0 {
		return core.Errorf("NetProfile is being used")
	}

	modeldb.RemoveLinkSet(&tenant.LinkSets.NetProfiles, netProfile)
	return nil
}
642856
func (o *Enterprise) NetconfProfiles(info *bambou.FetchingInfo) (NetconfProfilesList, *bambou.Error) {

	var list NetconfProfilesList
	err := bambou.CurrentSession().FetchChildren(o, NetconfProfileIdentity, &list, info)
	return list, err
}
662120
func (c *Client) DeleteWebProfile(profileID string) error {

	url := fmt.Sprintf("%s%s%s", c.APIBase, "/v1/payment-experience/web-profiles/", profileID)

	req, err := c.NewRequest("DELETE", url, nil)

	if err != nil {
		return err
	}

	if err = c.SendWithAuth(req, nil); err != nil {
		return err
	}

	return nil
}
624754
func (n *NetworkServerAPI) DeleteGatewayProfile(ctx context.Context, req *ns.DeleteGatewayProfileRequest) (*empty.Empty, error) {
	var gpID uuid.UUID
	copy(gpID[:], req.Id)

	if err := storage.DeleteGatewayProfile(storage.DB(), gpID); err != nil {
		return nil, errToRPCError(err)
	}

	return &empty.Empty{}, nil
}
547432
func (s *NetworkService) DeleteNetworkServiceProvider(p *DeleteNetworkServiceProviderParams) (*DeleteNetworkServiceProviderResponse, error) {
	resp, err := s.cs.newRequest("deleteNetworkServiceProvider", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteNetworkServiceProviderResponse
	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
		}

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

	return &r, nil
}
715209
func httpCreateNetprofile(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpGetNetprofile: %+v", vars)

	var obj Netprofile
	key := vars["key"]

	// Get object from the request
	err := json.NewDecoder(r.Body).Decode(&obj)
	if err != nil {
		log.Errorf("Error decoding netprofile create request. Err %v", err)
		return nil, err
	}

	// set the key
	obj.Key = key

	// Create the object
	err = CreateNetprofile(&obj)
	if err != nil {
		log.Errorf("CreateNetprofile error for: %+v. Err: %v", obj, err)
		return nil, err
	}

	// Return the obj
	return obj, nil
}
353583
func DeleteServiceProfile(db sqlx.Execer, id uuid.UUID) error {
	res, err := db.Exec("delete from service_profile where service_profile_id = $1", id)
	if err != nil {
		return handlePSQLError(err, "delete error")
	}

	ra, err := res.RowsAffected()
	if err != nil {
		return handlePSQLError(err, "get rows affected error")
	}
	if ra == 0 {
		return ErrDoesNotExist
	}

	log.WithField("id", id).Info("service-profile deleted")
	return nil
}
1349715
func (nDB *NetworkDB) deleteNetworkNode(nid string, nodeName string) {
	nodes, ok := nDB.networkNodes[nid]
	if !ok || len(nodes) == 0 {
		return
	}
	newNodes := make([]string, 0, len(nodes)-1)
	for _, name := range nodes {
		if name == nodeName {
			continue
		}
		newNodes = append(newNodes, name)
	}
	nDB.networkNodes[nid] = newNodes
}
52727
func (s *H264Settings) SetProfile(v string) *H264Settings {
	s.Profile = &v
	return s
}
619878
func (s *Service) AddOnDelete(ctx context.Context, appIdentity string, addOnIdentity string) (*AddOn, error) {
	var addOn AddOn
	return &addOn, s.Delete(ctx, &addOn, fmt.Sprintf("/apps/%v/addons/%v", appIdentity, addOnIdentity))
}
453341
func (c *ContivClient) VolumeProfileDelete(tenantName string, volumeProfileName string) error {
	// build key and URL
	keyStr := tenantName + ":" + volumeProfileName
	url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"

	// http get the object
	err := c.httpDelete(url)
	if err != nil {
		log.Debugf("Error deleting volumeProfile %s. Err: %v", keyStr, err)
		return err
	}

	return nil
}
1228152
func (s *CreateNetworkProfileOutput) SetNetworkProfile(v *NetworkProfile) *CreateNetworkProfileOutput {
	s.NetworkProfile = v
	return s
}
396421
func (c *Client) DeleteFabricNetwork(vlanID int16, networkID string) error {
	req := request{
		method:         client.DELETE,
		url:            makeURL(apiFabricVLANs, strconv.Itoa(int(vlanID)), apiFabricNetworks, networkID),
		expectedStatus: http.StatusNoContent,
	}
	if _, err := c.sendRequest(req); err != nil {
		return errors.Newf(err, "failed to delete fabric network %s on vlan %d", networkID, vlanID)
	}
	return nil
}
924987
func (b *BigIP) CreateOneconnectProfile(name string, parent string) error {
	config := &OneconnectProfile{
		Name:         name,
		DefaultsFrom: parent,
	}

	return b.post(config, uriLtm, uriProfile, uriOneConnect)
}
612014
func (c *Client) DeleteNetwork(p *DeleteNetworkParameter) (*Result, error) {
	obj, err := c.Request("deleteNetwork", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Result), err
}
339941
func (crud *repo) Delete(profile service.Entity) error {
	return dbconn.DB.Delete(&profile).Error
}
1243315
func (ac *APIController) TenantDelete(tenant *contivModel.Tenant) error {
	log.Infof("Received TenantDelete: %+v", tenant)

	// Get the state driver
	stateDriver, err := utils.GetStateDriver()
	if err != nil {
		return err
	}

	// if the tenant has associated app profiles, fail the delete
	profCount := len(tenant.LinkSets.AppProfiles)
	if profCount != 0 {
		return core.Errorf("cannot delete %s, has %d app profiles",
			tenant.TenantName, profCount)
	}
	// if the tenant has associated epgs, fail the delete
	epgCount := len(tenant.LinkSets.EndpointGroups)
	if epgCount != 0 {
		return core.Errorf("cannot delete %s has %d endpoint groups",
			tenant.TenantName, epgCount)
	}
	// if the tenant has associated policies, fail the delete
	policyCount := len(tenant.LinkSets.Policies)
	if policyCount != 0 {
		return core.Errorf("cannot delete %s has %d policies",
			tenant.TenantName, policyCount)
	}
	npCount := len(tenant.LinkSets.NetProfiles)
	if npCount != 0 {
		return core.Errorf("Cannot delete %s has %d netprofiles", tenant.TenantName, npCount)
	}
	// if the tenant has associated networks, fail the delete
	nwCount := len(tenant.LinkSets.Networks)
	if nwCount != 0 {
		return core.Errorf("cannot delete %s has %d networks",
			tenant.TenantName, nwCount)
	}

	// Build tenant config
	tenantCfg := intent.ConfigTenant{
		Name:           tenant.TenantName,
		DefaultNetwork: tenant.DefaultNetwork,
	}

	// Delete the tenant
	err = master.DeleteTenant(stateDriver, &tenantCfg)
	if err != nil {
		log.Errorf("Error deleting tenant %s. Err: %v", tenant.TenantName, err)
	}

	return nil
}