Skip to content

Commit c751d1a

Browse files
feat: Ingress
1 parent 32d4047 commit c751d1a

File tree

11 files changed

+471
-73
lines changed

11 files changed

+471
-73
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-ab6e971141b5e1f4e16583c5a17a9b30c488105b86cd2f06ded8930c1d3fe76e.yml
3-
openapi_spec_hash: bc58aaa77f9944435c91eb9129a3f105
4-
config_hash: b4e65d240d7bca1ba6162ee2098c8ac2
1+
configured_endpoints: 22
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-e5d271673921ab0a71b2c28bb60722b459bf94c927d0c41680b27db5b8f6d977.yml
3+
openapi_spec_hash: 89781fbe4b5bac8f45d8584c6aaf7b33
4+
config_hash: ea71f062b8803c872089ec60c46478be

api.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Response Types:
1717
Methods:
1818

1919
- <code title="post /images">client.Images.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#ImageService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#ImageNewParams">ImageNewParams</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Image">Image</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
20-
- <code title="get /images/{name}">client.Images.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#ImageService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, name <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Image">Image</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
2120
- <code title="get /images">client.Images.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#ImageService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>) ([]<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Image">Image</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
2221
- <code title="delete /images/{name}">client.Images.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#ImageService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, name <a href="https://pkg.go.dev/builtin#string">string</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
22+
- <code title="get /images/{name}">client.Images.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#ImageService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, name <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Image">Image</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
2323

2424
# Instances
2525

@@ -35,12 +35,12 @@ Response Types:
3535
Methods:
3636

3737
- <code title="post /instances">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceNewParams">InstanceNewParams</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
38-
- <code title="get /instances/{id}">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
3938
- <code title="get /instances">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>) ([]<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4039
- <code title="delete /instances/{id}">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
40+
- <code title="get /instances/{id}">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4141
- <code title="get /instances/{id}/logs">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.Logs">Logs</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceLogsParams">InstanceLogsParams</a>) (<a href="https://pkg.go.dev/builtin#string">string</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
42-
- <code title="post /instances/{id}/standby">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.PutInStandby">PutInStandby</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
43-
- <code title="post /instances/{id}/restore">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.RestoreFromStandby">RestoreFromStandby</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
42+
- <code title="post /instances/{id}/restore">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.Restore">Restore</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
43+
- <code title="post /instances/{id}/standby">client.Instances.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#InstanceService.Standby">Standby</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Instance">Instance</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4444

4545
## Volumes
4646

@@ -58,6 +58,28 @@ Response Types:
5858
Methods:
5959

6060
- <code title="post /volumes">client.Volumes.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeNewParams">VolumeNewParams</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Volume">Volume</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
61-
- <code title="get /volumes/{id}">client.Volumes.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Volume">Volume</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
6261
- <code title="get /volumes">client.Volumes.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>) ([]<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Volume">Volume</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
6362
- <code title="delete /volumes/{id}">client.Volumes.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
63+
- <code title="get /volumes/{id}">client.Volumes.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#VolumeService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Volume">Volume</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
64+
65+
# Ingresses
66+
67+
Params Types:
68+
69+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressMatchParam">IngressMatchParam</a>
70+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressRuleParam">IngressRuleParam</a>
71+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressTargetParam">IngressTargetParam</a>
72+
73+
Response Types:
74+
75+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Ingress">Ingress</a>
76+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressMatch">IngressMatch</a>
77+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressRule">IngressRule</a>
78+
- <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressTarget">IngressTarget</a>
79+
80+
Methods:
81+
82+
- <code title="post /ingresses">client.Ingresses.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressNewParams">IngressNewParams</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Ingress">Ingress</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
83+
- <code title="get /ingresses">client.Ingresses.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>) ([]<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Ingress">Ingress</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
84+
- <code title="delete /ingresses/{id}">client.Ingresses.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
85+
- <code title="get /ingresses/{id}">client.Ingresses.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#IngressService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/onkernel/hypeman-go#Ingress">Ingress</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type Client struct {
2121
Images ImageService
2222
Instances InstanceService
2323
Volumes VolumeService
24+
Ingresses IngressService
2425
}
2526

2627
// DefaultClientOptions read from the environment (HYPEMAN_API_KEY,
@@ -49,6 +50,7 @@ func NewClient(opts ...option.RequestOption) (r Client) {
4950
r.Images = NewImageService(opts...)
5051
r.Instances = NewInstanceService(opts...)
5152
r.Volumes = NewVolumeService(opts...)
53+
r.Ingresses = NewIngressService(opts...)
5254

5355
return
5456
}

image.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ func (r *ImageService) New(ctx context.Context, body ImageNewParams, opts ...opt
4444
return
4545
}
4646

47-
// Get image details
48-
func (r *ImageService) Get(ctx context.Context, name string, opts ...option.RequestOption) (res *Image, err error) {
49-
opts = slices.Concat(r.Options, opts)
50-
if name == "" {
51-
err = errors.New("missing required name parameter")
52-
return
53-
}
54-
path := fmt.Sprintf("images/%s", name)
55-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
56-
return
57-
}
58-
5947
// List images
6048
func (r *ImageService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Image, err error) {
6149
opts = slices.Concat(r.Options, opts)
@@ -77,6 +65,18 @@ func (r *ImageService) Delete(ctx context.Context, name string, opts ...option.R
7765
return
7866
}
7967

68+
// Get image details
69+
func (r *ImageService) Get(ctx context.Context, name string, opts ...option.RequestOption) (res *Image, err error) {
70+
opts = slices.Concat(r.Options, opts)
71+
if name == "" {
72+
err = errors.New("missing required name parameter")
73+
return
74+
}
75+
path := fmt.Sprintf("images/%s", name)
76+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
77+
return
78+
}
79+
8080
type Image struct {
8181
// Creation timestamp (RFC3339)
8282
CreatedAt time.Time `json:"created_at,required" format:"date-time"`

image_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestImageNew(t *testing.T) {
3838
}
3939
}
4040

41-
func TestImageGet(t *testing.T) {
41+
func TestImageList(t *testing.T) {
4242
t.Skip("Prism tests are disabled")
4343
baseURL := "http://localhost:4010"
4444
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
@@ -51,7 +51,7 @@ func TestImageGet(t *testing.T) {
5151
option.WithBaseURL(baseURL),
5252
option.WithAPIKey("My API Key"),
5353
)
54-
_, err := client.Images.Get(context.TODO(), "name")
54+
_, err := client.Images.List(context.TODO())
5555
if err != nil {
5656
var apierr *hypeman.Error
5757
if errors.As(err, &apierr) {
@@ -61,7 +61,7 @@ func TestImageGet(t *testing.T) {
6161
}
6262
}
6363

64-
func TestImageList(t *testing.T) {
64+
func TestImageDelete(t *testing.T) {
6565
t.Skip("Prism tests are disabled")
6666
baseURL := "http://localhost:4010"
6767
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
@@ -74,7 +74,7 @@ func TestImageList(t *testing.T) {
7474
option.WithBaseURL(baseURL),
7575
option.WithAPIKey("My API Key"),
7676
)
77-
_, err := client.Images.List(context.TODO())
77+
err := client.Images.Delete(context.TODO(), "name")
7878
if err != nil {
7979
var apierr *hypeman.Error
8080
if errors.As(err, &apierr) {
@@ -84,7 +84,7 @@ func TestImageList(t *testing.T) {
8484
}
8585
}
8686

87-
func TestImageDelete(t *testing.T) {
87+
func TestImageGet(t *testing.T) {
8888
t.Skip("Prism tests are disabled")
8989
baseURL := "http://localhost:4010"
9090
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
@@ -97,7 +97,7 @@ func TestImageDelete(t *testing.T) {
9797
option.WithBaseURL(baseURL),
9898
option.WithAPIKey("My API Key"),
9999
)
100-
err := client.Images.Delete(context.TODO(), "name")
100+
_, err := client.Images.Get(context.TODO(), "name")
101101
if err != nil {
102102
var apierr *hypeman.Error
103103
if errors.As(err, &apierr) {

0 commit comments

Comments
 (0)