@@ -2,8 +2,6 @@ package v1
22
33import (
44 "context"
5- "crypto/sha256"
6- "fmt"
75 "net/http"
86 "time"
97
@@ -12,51 +10,6 @@ import (
1210 "github.com/cenkalti/backoff/v4"
1311)
1412
15- // LambdaLabsCredential implements the CloudCredential interface for Lambda Labs
16- type LambdaLabsCredential struct {
17- RefID string
18- APIKey string
19- }
20-
21- var _ v1.CloudCredential = & LambdaLabsCredential {}
22-
23- // NewLambdaLabsCredential creates a new Lambda Labs credential
24- func NewLambdaLabsCredential (refID , apiKey string ) * LambdaLabsCredential {
25- return & LambdaLabsCredential {
26- RefID : refID ,
27- APIKey : apiKey ,
28- }
29- }
30-
31- // GetReferenceID returns the reference ID for this credential
32- func (c * LambdaLabsCredential ) GetReferenceID () string {
33- return c .RefID
34- }
35-
36- // GetAPIType returns the API type for Lambda Labs
37- func (c * LambdaLabsCredential ) GetAPIType () v1.APIType {
38- return v1 .APITypeGlobal
39- }
40-
41- const CloudProviderID = "lambda-labs"
42-
43- const DefaultRegion string = "us-west-1"
44-
45- // GetCloudProviderID returns the cloud provider ID for Lambda Labs
46- func (c * LambdaLabsCredential ) GetCloudProviderID () v1.CloudProviderID {
47- return CloudProviderID
48- }
49-
50- // GetTenantID returns the tenant ID for Lambda Labs
51- func (c * LambdaLabsCredential ) GetTenantID () (string , error ) {
52- return fmt .Sprintf ("lambdalabs-%x" , sha256 .Sum256 ([]byte (c .APIKey ))), nil
53- }
54-
55- // MakeClient creates a new Lambda Labs client from this credential
56- func (c * LambdaLabsCredential ) MakeClient (_ context.Context , _ string ) (v1.CloudClient , error ) {
57- return NewLambdaLabsClient (c .RefID , c .APIKey ), nil
58- }
59-
6013// LambdaLabsClient implements the CloudClient interface for Lambda Labs
6114// It embeds NotImplCloudClient to handle unsupported features
6215type LambdaLabsClient struct {
@@ -91,7 +44,7 @@ func (c *LambdaLabsClient) GetAPIType() v1.APIType {
9144
9245// GetCloudProviderID returns the cloud provider ID for Lambda Labs
9346func (c * LambdaLabsClient ) GetCloudProviderID () v1.CloudProviderID {
94- return "lambdalabs"
47+ return CloudProviderID
9548}
9649
9750// MakeClient creates a new client instance
0 commit comments