// RevokeExternalConnectivity method is invoked to remove any external connectivity programming related to the endpoint.
555569
func (d *driver) RevokeExternalConnectivity(nid, eid string) error {
	data := &api.RevokeExternalConnectivityRequest{
		NetworkID:  nid,
		EndpointID: eid,
	}
	err := d.call("RevokeExternalConnectivity", data, &api.RevokeExternalConnectivityResponse{})
	if err != nil && plugins.IsNotFound(err) {
		// It is not mandatory yet to support this method
		return nil
	}
	return err
}
56694
func NewExternalControllerConnection(apiInfo *api.Info) (api.Connection, error) {
	return api.Open(apiInfo, api.DialOpts{
		Timeout:    2 * time.Second,
		RetryDelay: 500 * time.Millisecond,
	})
}
853698
func (s *remoteSite) removeInvalidConns() {
	// for first pass, do nothing if no connections are marked
	count := 0
	for _, conn := range s.connections {
		if conn.isInvalid() {
			count++
		}
	}
	if count == 0 {
		return
	}
	s.lastUsed = 0
	conns := make([]*remoteConn, 0, len(s.connections)-count)
	for i := range s.connections {
		if !s.connections[i].isInvalid() {
			conns = append(conns, s.connections[i])
		} else {
			go s.connections[i].Close()
		}
	}
	s.connections = conns
}
133012
func (l *Listener) disconnectCleanup() error {
	l.lock.Lock()
	defer l.lock.Unlock()

	// sanity check; can't look at Err() until the channel has been closed
	select {
	case _, ok := <-l.connNotificationChan:
		if ok {
			panic("connNotificationChan not closed")
		}
	default:
		panic("connNotificationChan not closed")
	}

	err := l.cn.Err()
	l.cn.Close()
	l.cn = nil
	return err
}
855709
func ActivateDeviceWithExternal(poolName string, name string, deviceID int, size uint64, external string) error {
	return activateDevice(poolName, name, deviceID, size, external)
}
1021593
func (c *CertificateService) Revoke(req acme.RevokeCertMessage) error {
	_, err := c.core.post(c.core.GetDirectory().RevokeCertURL, req, nil)
	return err
}
148448
func WithExternalVCC(val bool) func(Config) {
	return func(c Config) {
		d, ok := c.(*SSD1306Driver)
		if ok {
			d.ExternalVcc = val
		} else {
			panic("unable to set rst pin for ssd1306")
		}
	}
}
459418
func (r *ExecREST) NewConnectOptions() (runtime.Object, bool, string) {
	return &api.PodExecOptions{}, false, ""
}
390631
func (s *ClientProperties) SetReconnectEnabled(v string) *ClientProperties {
	s.ReconnectEnabled = &v
	return s
}
964004
func (p *Client) CancelConnection() error {
	p.Lock()
	defer p.Unlock()
	return p.conn.Close()
}
321730
func (s *ModifyEndpointInput) SetExtraConnectionAttributes(v string) *ModifyEndpointInput {
	s.ExtraConnectionAttributes = &v
	return s
}
1288563
func (k *KeyPairsClient) Revoke(ctx context.Context, orgID *identity.ID, output ProgressFunc) error {
	return k.worker(ctx, "revoke", orgID, output)
}
290641
func (r *Relation) removeLocalEndpointOps(ep Endpoint, departingUnitName string, op *ForcedOperation) ([]txn.Op, error) {
	var asserts bson.D
	hasRelation := bson.D{{"relationcount", bson.D{{"$gt", 0}}}}
	departingUnitApplicationMatchesEndpoint := func() bool {
		s, err := names.UnitApplication(departingUnitName)
		return err == nil && s == ep.ApplicationName
	}
	var cleanupOps []txn.Op
	if departingUnitName == "" {
		// We're constructing a destroy operation, either of the relation
		// or one of its applications, and can therefore be assured that both
		// applications are Alive.
		asserts = append(hasRelation, isAliveDoc...)
	} else if departingUnitApplicationMatchesEndpoint() {
		// This application must have at least one unit -- the one that's
		// departing the relation -- so it cannot be ready for removal.
		cannotDieYet := bson.D{{"unitcount", bson.D{{"$gt", 0}}}}
		asserts = append(hasRelation, cannotDieYet...)
	} else {
		// This application may require immediate removal.
		// Check if the application is Dying, and if so, queue up a potential
		// cleanup in case this was the last reference.
		applications, closer := r.st.db().GetCollection(applicationsC)
		defer closer()

		asserts = append(hasRelation)
		var appDoc applicationDoc
		if err := applications.FindId(ep.ApplicationName).One(&appDoc); err == nil {
			if appDoc.Life != Alive {
				cleanupOps = append(cleanupOps, newCleanupOp(
					cleanupApplication,
					ep.ApplicationName,
					false, // destroyStorage
					op.Force,
				))
			}
		} else if !op.Force {
			return nil, errors.Trace(err)
		}
	}
	return append([]txn.Op{{
		C:      applicationsC,
		Id:     r.st.docID(ep.ApplicationName),
		Assert: asserts,
		Update: bson.D{{"$inc", bson.D{{"relationcount", -1}}}},
	}}, cleanupOps...), nil
}
431982
func revokeAllRouteTableRules(defaultRouteTableId string, meta interface{}) error {
	conn := meta.(*AWSClient).ec2conn
	log.Printf("\n***\nrevokeAllRouteTableRules\n***\n")

	resp, err := conn.DescribeRouteTables(&ec2.DescribeRouteTablesInput{
		RouteTableIds: []*string{aws.String(defaultRouteTableId)},
	})
	if err != nil {
		return err
	}

	if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil {
		return fmt.Errorf("Default Route table not found")
	}

	rt := resp.RouteTables[0]

	// Remove all Gateway association
	for _, r := range rt.PropagatingVgws {
		log.Printf(
			"[INFO] Deleting VGW propagation from %s: %s",
			defaultRouteTableId, *r.GatewayId)
		_, err := conn.DisableVgwRoutePropagation(&ec2.DisableVgwRoutePropagationInput{
			RouteTableId: aws.String(defaultRouteTableId),
			GatewayId:    r.GatewayId,
		})
		if err != nil {
			return err
		}
	}

	// Delete all routes
	for _, r := range rt.Routes {
		// you cannot delete the local route
		if r.GatewayId != nil && *r.GatewayId == "local" {
			continue
		}
		if r.DestinationPrefixListId != nil {
			// Skipping because VPC endpoint routes are handled separately
			// See aws_vpc_endpoint
			continue
		}

		if r.DestinationCidrBlock != nil {
			log.Printf(
				"[INFO] Deleting route from %s: %s",
				defaultRouteTableId, *r.DestinationCidrBlock)
			_, err := conn.DeleteRoute(&ec2.DeleteRouteInput{
				RouteTableId:         aws.String(defaultRouteTableId),
				DestinationCidrBlock: r.DestinationCidrBlock,
			})
			if err != nil {
				return err
			}
		}

		if r.DestinationIpv6CidrBlock != nil {
			log.Printf(
				"[INFO] Deleting route from %s: %s",
				defaultRouteTableId, *r.DestinationIpv6CidrBlock)
			_, err := conn.DeleteRoute(&ec2.DeleteRouteInput{
				RouteTableId:             aws.String(defaultRouteTableId),
				DestinationIpv6CidrBlock: r.DestinationIpv6CidrBlock,
			})
			if err != nil {
				return err
			}
		}

	}

	return nil
}
1092593
func (s *HistoryEvent) SetExternalWorkflowExecutionSignaledEventAttributes(v *ExternalWorkflowExecutionSignaledEventAttributes) *HistoryEvent {
	s.ExternalWorkflowExecutionSignaledEventAttributes = v
	return s
}
1200965
func RemovePortFromRemoteAddr(remoteAddr string) string {
	pos := strings.LastIndex(remoteAddr, ":")
	if pos < 0 {
		return remoteAddr
	}

	return remoteAddr[:pos]
}
259318
func (r Network_Interconnect_Tenant) DeleteConnection(receivedObject *datatypes.Network_Interconnect_Tenant) (resp bool, err error) {
	params := []interface{}{
		receivedObject,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Interconnect_Tenant", "deleteConnection", params, &r.Options, &resp)
	return
}