// GetExport gets an export by id
549752
func (mg *MailgunImpl) GetExport(ctx context.Context, id string) (Export, error) {
	r := newHTTPRequest(generatePublicApiUrl(mg, exportsEndpoint) + "/" + id)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	var resp Export
	err := getResponseFromJSON(ctx, r, &resp)
	return resp, err
}
522405
func (p *Pubring) Export(id string) ([]byte, error) {
	p.Lock()
	defer p.Unlock()

	xpk := p.fetch(id)
	if xpk == nil {
		if p.secring != nil {
			return p.secring.Export(id, false)
		}
		return nil, fmt.Errorf("key not found")
	}

	return proto.Marshal(xpk)
}
946465
func GetExtension(tx ReadTx, id string) *api.Extension {
	e := tx.get(tableExtension, id)
	if e == nil {
		return nil
	}
	return e.(extensionEntry).Extension
}
567042
func (u user) GetExtra() map[string][]string {
	m := map[string][]string{}
	for k, v := range u.Extra {
		m[k] = []string(v)
	}
	return m
}
1145689
func (d *OvsdbDriver) GetInterfacesInPort(portName string) []string {
	var intfList []string
	d.cacheLock.RLock()
	defer d.cacheLock.RUnlock()

	for _, row := range d.cache["Port"] {
		name := row.Fields["name"].(string)
		if name == portName {
			// Port found
			// Iterate over the list of interfaces
			switch (row.Fields["interfaces"]).(type) {
			case libovsdb.UUID: // Individual interface case
				intfUUID := row.Fields["interfaces"].(libovsdb.UUID)
				intfInfo := d.GetIntfInfo(intfUUID)
				if reflect.DeepEqual(intfInfo, libovsdb.Row{}) {
					log.Errorf("could not find interface with UUID: %+v", intfUUID)
					break
				}
				intfList = append(intfList, intfInfo.Fields["name"].(string))
			case libovsdb.OvsSet: // Port bond case
				intfUUIDList := row.Fields["interfaces"].(libovsdb.OvsSet)
				for _, intfUUID := range intfUUIDList.GoSet {
					intfInfo := d.GetIntfInfo(intfUUID.(libovsdb.UUID))
					if reflect.DeepEqual(intfInfo, libovsdb.Row{}) {
						continue
					}
					intfList = append(intfList, intfInfo.Fields["name"].(string))
				}
			}
			sort.Strings(intfList)
			break
		}
	}
	return intfList
}
615563
func (client *AVTransport2) GetTransportInfo(InstanceID uint32) (CurrentTransportState string, CurrentTransportStatus string, CurrentSpeed string, err error) {
	// Request structure.
	request := &struct {
		InstanceID string
	}{}
	// BEGIN Marshal arguments into request.

	if request.InstanceID, err = soap.MarshalUi4(InstanceID); err != nil {
		return
	}
	// END Marshal arguments into request.

	// Response structure.
	response := &struct {
		CurrentTransportState  string
		CurrentTransportStatus string
		CurrentSpeed           string
	}{}

	// Perform the SOAP call.
	if err = client.SOAPClient.PerformAction(URN_AVTransport_2, "GetTransportInfo", request, response); err != nil {
		return
	}

	// BEGIN Unmarshal arguments from response.

	if CurrentTransportState, err = soap.UnmarshalString(response.CurrentTransportState); err != nil {
		return
	}
	if CurrentTransportStatus, err = soap.UnmarshalString(response.CurrentTransportStatus); err != nil {
		return
	}
	if CurrentSpeed, err = soap.UnmarshalString(response.CurrentSpeed); err != nil {
		return
	}
	// END Unmarshal arguments from response.
	return
}
528272
func (c *Client) GetExportClients(
	ctx context.Context, name string) ([]string, error) {

	ex, err := c.GetExportByName(ctx, name)
	if err != nil {
		return nil, err
	}
	if ex == nil {
		return nil, nil
	}
	if ex.Clients == nil {
		return nil, nil
	}
	return *ex.Clients, nil
}
210018
func (v *TypeReference) GetImportPath() (o string) {
	if v != nil {
		o = v.ImportPath
	}
	return
}
965490
func (c *Client) Export(ctx context.Context, name string) (int, error) {

	ok, id, err := c.IsExported(ctx, name)
	if err != nil {
		return 0, err
	}
	if ok {
		return id, nil
	}

	paths := []string{c.API.VolumePath(name)}

	return api.ExportCreate(
		ctx, c.API,
		&api.Export{Paths: &paths})
}
880041
func (n *nessusImpl) DownloadExport(scanID, exportID int64) ([]byte, error) {
	if n.verbose {
		log.Println("Downloading export file...")
	}

	resp, err := n.doRequest("GET", fmt.Sprintf("/scans/%d/export/%d/download", scanID, exportID), nil, []int{http.StatusOK})
	if err != nil {
		return nil, err
	}
	body, err := ioutil.ReadAll(resp.Body)
	defer resp.Body.Close()
	if err != nil {
		return nil, err
	}
	return body, err
}
598455
func (f *NWFilterBinding) GetPortDev() (string, error) {
	if C.LIBVIR_VERSION_NUMBER < 4005000 {
		return "", makeNotImplementedError("virNWFilterBindingGetPortDev")
	}
	var err C.virError
	result := C.virNWFilterBindingGetPortDevWrapper(f.ptr, &err)
	if result == nil {
		return "", makeError(&err)
	}
	name := C.GoString(result)
	C.free(unsafe.Pointer(result))
	return name, nil
}
23226
func (s *SourceImportAuthor) GetID() int64 {
	if s == nil || s.ID == nil {
		return 0
	}
	return *s.ID
}
1136533
func (c *Client) UnexportByID(
	ctx context.Context, id int) error {

	return api.Unexport(ctx, c.API, id)
}
45281
func (oe *V1Exporter) Export(ctx context.Context, store content.Provider, desc ocispec.Descriptor, writer io.Writer) error {
	tw := tar.NewWriter(writer)
	defer tw.Close()

	records := []tarRecord{
		ociLayoutFile(""),
		ociIndexRecord(desc),
	}

	algorithms := map[string]struct{}{}
	exportHandler := func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
		records = append(records, blobRecord(store, desc))
		algorithms[desc.Digest.Algorithm().String()] = struct{}{}
		return nil, nil
	}

	childrenHandler := images.ChildrenHandler(store)

	if !oe.AllPlatforms {
		// get local default platform to fetch image manifest
		childrenHandler = images.FilterPlatforms(childrenHandler, platforms.Any(platforms.DefaultSpec()))
	}

	handlers := images.Handlers(
		childrenHandler,
		images.HandlerFunc(exportHandler),
	)

	// Walk sequentially since the number of fetchs is likely one and doing in
	// parallel requires locking the export handler
	if err := images.Walk(ctx, handlers, desc); err != nil {
		return err
	}

	if len(algorithms) > 0 {
		records = append(records, directoryRecord("blobs/", 0755))
		for alg := range algorithms {
			records = append(records, directoryRecord("blobs/"+alg+"/", 0755))
		}
	}

	return writeTar(ctx, tw, records)
}
757095
func (m *Maestro) GetSpecificExposedPort(service string, container string, port string) (uint16, error) {
	return m.getPortHelper(service, container, port, "INTERNAL_PORT")
}
964561
func DeleteExports(conn client.Connection, tenantID string) error {
	pth := path.Join("/net/export", tenantID)
	logger := plog.WithFields(log.Fields{
		"tenantid": tenantID,
		"zkpath":   pth,
	})

	if err := conn.Delete(pth); err == client.ErrNoNode {
		logger.Debug("No exports for tenant id")
		return nil
	} else if err != nil {
		logger.WithError(err).Debug("Could not delete exports for tenant id")
		return err
	}

	logger.Debug("Removed exports for tenant id")
	return nil
}
65707
func (c *Client) GetExportRootClients(
	ctx context.Context, name string) ([]string, error) {

	ex, err := c.GetExportByName(ctx, name)
	if err != nil {
		return nil, err
	}
	if ex == nil {
		return nil, nil
	}
	if ex.RootClients == nil {
		return nil, nil
	}
	return *ex.RootClients, nil
}