func (r *ProtocolLXD) GetServer() (*api.Server, string, error) {
	server := api.Server{}

	// Fetch the raw value
	etag, err := r.queryStruct("GET", "", nil, "", &server)
	if err != nil {
		return nil, "", err
	}

	// Fill in certificate fingerprint if not provided
	if server.Environment.CertificateFingerprint == "" && server.Environment.Certificate != "" {
		var err error
		server.Environment.CertificateFingerprint, err = shared.CertFingerprintStr(server.Environment.Certificate)
		if err != nil {
			return nil, "", err
		}
	}

	if !server.Public && len(server.AuthMethods) == 0 {
		// TLS is always available for LXD servers
		server.AuthMethods = []string{"tls"}
	}

	// Add the value to the cache
	r.server = &server

	return &server, etag, nil
}
func (r *ProtocolLXD) GetServer() (*api.Server, string, error) {
	server := api.Server{}

	
	etag, err := r.queryStruct("GET", "", nil, "", &server)
	if err != nil {
		return nil, "", err
	}

	
	if server.Environment.CertificateFingerprint == "" && server.Environment.Certificate != "" {
		var err error
		server.Environment.CertificateFingerprint, err = shared.CertFingerprintStr(server.Environment.Certificate)
		if err != nil {
			return nil, "", err
		}
	}

	if !server.Public && len(server.AuthMethods) == 0 {
		
		server.AuthMethods = []string{"tls"}
	}

	
	r.server = &server

	return &server, etag, nil
}
func ( r * ProtocolLXD ) GetServer ( ) ( * api . Server , string , error ) { server := api . Server { } // Fetch the raw value etag , err := r . queryStruct ( " " , " " , nil , " " , & server ) if err != nil { return nil , " " , err } // Fill in certificate fingerprint if not provided if server . Environment . CertificateFingerprint == " " && server . Environment . Certificate != " " { var err error server . Environment . CertificateFingerprint , err = shared . CertFingerprintStr ( server . Environment . Certificate ) if err != nil { return nil , " " , err } } if ! server . Public && len ( server . AuthMethods ) == 0 { // TLS is always available for LXD servers server . AuthMethods = [ ] string { " " } } // Add the value to the cache r . server = & server return & server , etag , nil }
// Server handling functions
// GetServer returns the server status as a Server struct
Server handling functions GetServer returns the server status as a Server struct