// GetServiceProperty returns property for given service name and property name
558125
func (c *Conn) GetServiceProperty(service string, propertyName string) (*Property, error) {
	return c.getProperty(service, "org.freedesktop.systemd1.Service", propertyName)
}
125958
func (c Client) GetServiceExtensionMap(service *ServiceItem, app *ApplicationItem, extensionKey string) (map[string]string, error) {
	extensionData := ServiceExtensionLabels{}
	err := c.GetServiceExtension(app.TypeName, app.TypeVersion, service.TypeName, extensionKey, &extensionData)
	if err != nil {
		return nil, err
	}

	labels := map[string]string{}
	if extensionData.Label != nil {
		for _, label := range extensionData.Label {
			labels[label.Key] = label.Value
		}
	}

	return labels, nil
}
1165460
func (this *ControlPlaneDao) GetService(id string, myService *service.Service) error {
	svc, err := this.facade.GetService(datastore.Get(), id)
	if svc != nil {
		*myService = *svc
	}
	return err
}
169825
func getServiceType(r *http.Request) string {
	service_type := r.FormValue("service")

	if s := strings.HasPrefix(service_type, "git-"); !s {
		return ""
	}

	return strings.Replace(service_type, "git-", "", 1)
}
38415
func (client *Client) GetServiceInstanceSharedFrom(serviceInstanceGUID string) (ServiceInstanceSharedFrom, Warnings, error) {
	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.GetServiceInstanceSharedFromRequest,
		URIParams:   Params{"service_instance_guid": serviceInstanceGUID},
	})
	if err != nil {
		return ServiceInstanceSharedFrom{}, nil, err
	}

	var serviceInstanceSharedFrom ServiceInstanceSharedFrom
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &serviceInstanceSharedFrom,
	}

	err = client.connection.Make(request, &response)
	return serviceInstanceSharedFrom, response.Warnings, err
}
823693
func (c Client) GetServiceLabels(service *ServiceItem, app *ApplicationItem, prefix string) (map[string]string, error) {
	extensionData := ServiceExtensionLabels{}
	err := c.GetServiceExtension(app.TypeName, app.TypeVersion, service.TypeName, prefix, &extensionData)
	if err != nil {
		return nil, err
	}

	prefixPeriod := prefix + "."

	labels := map[string]string{}
	if extensionData.Label != nil {
		for _, label := range extensionData.Label {
			if strings.HasPrefix(label.Key, prefixPeriod) {
				labelKey := strings.Replace(label.Key, prefixPeriod, "", -1)
				labels[labelKey] = label.Value
			}
		}
	}

	exists, properties, err := c.GetProperties(service.ID)
	if err != nil {
		return nil, err
	}

	if exists {
		for k, v := range properties {
			if strings.HasPrefix(k, prefixPeriod) {
				labelKey := strings.Replace(k, prefixPeriod, "", -1)
				labels[labelKey] = v
			}
		}
	}

	return labels, nil
}
825986
func (db *DB) GetProperty(propName string) string {
	cprop := C.CString(propName)
	defer C.free(unsafe.Pointer(cprop))
	cValue := C.rocksdb_property_value(db.c, cprop)
	defer C.free(unsafe.Pointer(cValue))
	return C.GoString(cValue)
}
978285
func GetUnsupportedProperties(configDicts ...map[string]interface{}) []string {
	unsupported := map[string]bool{}

	for _, configDict := range configDicts {
		for _, service := range getServices(configDict) {
			serviceDict := service.(map[string]interface{})
			for _, property := range types.UnsupportedProperties {
				if _, isSet := serviceDict[property]; isSet {
					unsupported[property] = true
				}
			}
		}
	}

	return sortedKeys(unsupported)
}
1128623
func (actor Actor) GetServicePlansForService(serviceName, brokerName string) ([]ServicePlan, Warnings, error) {
	service, allWarnings, err := actor.GetServiceByNameAndBrokerName(serviceName, brokerName)
	if err != nil {
		return []ServicePlan{}, allWarnings, err
	}

	servicePlans, warnings, err := actor.CloudControllerClient.GetServicePlans(ccv2.Filter{
		Type:     constant.ServiceGUIDFilter,
		Operator: constant.EqualOperator,
		Values:   []string{service.GUID},
	})
	allWarnings = append(allWarnings, warnings...)
	if err != nil {
		return []ServicePlan{}, allWarnings, err
	}

	var plansToReturn []ServicePlan
	for _, plan := range servicePlans {
		plansToReturn = append(plansToReturn, ServicePlan(plan))
	}

	return plansToReturn, allWarnings, nil
}
135056
func (obj *GenericMeasure) GetProperties(ctx context.Context) (*GenericMeasureProperties, error) {
	result := &struct {
		Prop *GenericMeasureProperties	`json:"qProp"`
	} {}
	err := obj.rpc(ctx, "GetProperties", result)
	return result.Prop, err 
}
887172
func (vm *VM) getServiceClient() (hostedservice.HostedServiceClient, error) {
	c, err := vm.getClient()
	if err != nil {
		return hostedservice.HostedServiceClient{}, err
	}

	return hostedservice.NewClient(c), nil
}
173897
func (c *Client) GetServiceDetailsByTenantID(tenantID string) ([]service.ServiceDetails, error) {
	svcs := []service.ServiceDetails{}
	err := c.call("GetServiceDetailsByTenantID", tenantID, &svcs)
	return svcs, err
}
661424
func (f *Facade) GetServiceAddressAssignmentDetails(ctx datastore.Context, serviceID string, children bool) ([]service.IPAssignment, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetServiceAddressAssignmentDetails"))
	logger := plog.WithFields(log.Fields{
		"parentserviceid": serviceID,
		"children":        children,
	})

	// Get a list of all ip assignments in the entire system based on services with endpoints
	// (not records in the addressassignment store)
	allIPs, err := f.serviceStore.GetAllIPAssignments(ctx)
	if err != nil {
		logger.WithError(err).Error("Could not look up address assignments")
		return nil, err
	} else if len(allIPs) == 0 {
		return []service.IPAssignment{}, nil
	}

	// Build a map of those assignments which belong to the specified serviceID or any of its children
	serviceIPs := make(map[string]service.BaseIPAssignment)
	gs := func(id string) (*service.ServiceDetails, error) {
		return f.GetServiceDetails(ctx, id)
	}
	for _, ip := range allIPs {
		key := fmt.Sprintf("%s-%s", ip.ServiceID, ip.EndpointName)
		if _, ok := serviceIPs[key]; ok {
			continue
		}
		if ip.ServiceID == serviceID {
			serviceIPs[key] = ip
		} else if children {
			_, servicePath, err := f.serviceCache.GetServicePath(ip.ServiceID, gs)
			if err != nil {
				logger.WithError(err).WithField("serviceid", ip.ServiceID).Error("Could not find service")
				return nil, err
			}
			if strings.Contains(servicePath, serviceID) {
				serviceIPs[key] = ip
			}
		}
	}

	// For each service endpoint that needs an address assignement,
	// 	retrieve the corresponding assignment from the DB
	store := addressassignment.NewStore()
	ipAssignments := []service.IPAssignment{}
	for _, ip := range serviceIPs {
		servicelogger := logger.WithFields(log.Fields{
			"serviceid":    ip.ServiceID,
			"servicename":  ip.ServiceName,
			"poolid":       ip.PoolID,
			"endpointname": ip.EndpointName,
			"children":     children,
		})
		ipassignment := service.IPAssignment{
			BaseIPAssignment: ip,
		}
		addr, err := store.FindAssignmentByServiceEndpoint(ctx, ip.ServiceID, ip.EndpointName)
		if err != nil {
			err := fmt.Errorf("Can not find address assignment")
			servicelogger.WithFields(log.Fields{
				"endpointname": ip.EndpointName,
			}).WithError(err).Error("Address assignment lookup failed")
			return nil, err
		}

		if addr != nil {
			// Get the host info for the address assignment
			var hostID, hostName string
			if addr.AssignmentType == "virtual" {
				hostID, _ = f.zzk.GetVirtualIPHostID(ip.PoolID, addr.IPAddr)
			} else {
				hostID = addr.HostID
			}

			if hostID != "" {
				hst := &host.Host{}
				if err := f.hostStore.Get(ctx, host.HostKey(hostID), hst); err != nil {
					servicelogger.WithField("hostid", hostID).WithError(err).Debug("Could not look up host for address assignment")
					return nil, err
				}
				hostName = hst.Name
			}

			ipassignment.Type = addr.AssignmentType
			ipassignment.HostID = hostID
			ipassignment.HostName = hostName
			ipassignment.IPAddress = addr.IPAddr
			servicelogger.Debug("Set address assignment for service endpoint")
		} else {
			servicelogger.Debug("No address assignment available for service endpoint")
		}

		// Append a new record for the port
		ipAssignments = append(ipAssignments, ipassignment)
	}
	return ipAssignments, nil
}
244987
func (c *ConfigurationData) GetDeprecatedServiceAccountPrivateKey() ([]byte, string) {
	return []byte(c.v.GetString(varServiceAccountPrivateKeyDeprecated)), c.v.GetString(varServiceAccountPrivateKeyIDDeprecated)
}
232971
func MustGetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) {
	r, err := GetProperty(disp, name, params...)
	if err != nil {
		panic(err.Error())
	}
	return r
}
660751
func (bp BodiesProperty) GetProperty(name string) Property {
	p, ok := bp.Properties[name]
	if !ok {
		panic(fmt.Errorf("can't find property name %v", name))
	}
	return toProperty(name, p)
}
839367
func (c Client) GetProperties(name string) (bool, map[string]string, error) {
	nameExists, err := c.nameExists(name)
	if err != nil {
		return false, nil, err
	}

	if !nameExists {
		return false, nil, nil
	}

	properties := make(map[string]string)

	var continueToken string
	for {
		res, err := c.getHTTP("Names/"+name+"/$/GetProperties", withContinue(continueToken), withParam("IncludeValues", "true"))
		if err != nil {
			return false, nil, err
		}

		var propertiesListPage PropertiesListPage
		err = json.Unmarshal(res, &propertiesListPage)
		if err != nil {
			return false, nil, fmt.Errorf("could not deserialise JSON response: %+v", err)
		}

		for _, property := range propertiesListPage.Properties {
			if property.Value.Kind != "String" {
				continue
			}
			properties[property.Name] = property.Value.Data
		}

		continueToken = propertiesListPage.ContinuationToken
		if continueToken == "" {
			break
		}
	}

	return true, properties, nil
}