func (b *baremetal) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error) {
	baremetalServer, err := b.getServerByProviderID(providerID)
	if err != nil {
		return "", err
	}
	return b.getServerOfferName(baremetalServer)
}
InstanceTypeByProviderID returns the type of the specified instance (ex. GP-BM1-M, HC-BM1-S,...).
package scaleway
import (
	"context"
	scwbaremetal "github.com/scaleway/scaleway-sdk-go/api/baremetal/v1alpha1"
	"github.com/scaleway/scaleway-sdk-go/scw"
	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/types"
	cloudprovider "k8s.io/cloud-provider"
	"k8s.io/klog/v2"
)
type baremetal struct {
	api BaremetalAPI
}
type BaremetalAPI interface {
	ListServers(req *scwbaremetal.ListServersRequest, opts ...scw.RequestOption) (*scwbaremetal.ListServersResponse, error)
	GetServer(req *scwbaremetal.GetServerRequest, opts ...scw.RequestOption) (*scwbaremetal.Server, error)
	GetOffer(req *scwbaremetal.GetOfferRequest, opts ...scw.RequestOption) (*scwbaremetal.Offer, error)
}
func newBaremetal(client *client) *baremetal {
	return &baremetal{
		api: scwbaremetal.NewAPI(client.scaleway),
	}
}
func (b *baremetal) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error) {
	baremetalServer, err := b.getServerByName(string(name))
	if err != nil {
		return nil, err
	}
	return baremetalAddresses(baremetalServer), nil
}
func (b *baremetal) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error) {
	baremetalServer, err := b.getServerByProviderID(providerID)
	if err != nil {
		return nil, err
	}
	return baremetalAddresses(baremetalServer), nil
}
func (b *baremetal) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error) {
	baremetalServer, err := b.getServerByName(string(nodeName))
	if err != nil {
		return "", err
	}
	return BuildProviderID(InstanceTypeBaremtal, string(baremetalServer.Zone), baremetalServer.ID), nil
}
func (b *baremetal) InstanceType(ctx context.Context, name types.NodeName) (string, error) {
	baremetalServer, err := b.getServerByName(string(name))
	if err != nil {
		return "", err
	}
	return b.getServerOfferName(baremetalServer)
}