Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.32.0"
".": "0.33.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 645
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-afac9651736e871ab5942174b1c2b741d31f17c1f4ac61e78f0000f1b3fd8d09.yml
openapi_spec_hash: 9c57a763b4c6b82b581defdcaf5f52df
config_hash: 7552912a8ca7c67b43b97f51b67a5ae7
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-06555b1b7559c234823e37c3970ba3ea9f11ed14270b872b22761f6be8692e74.yml
openapi_spec_hash: 619bca59fafad89221a4b35f797f14f1
config_hash: bc578a7de14c42e33b7d4bd4502218f2
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.33.0 (2026-02-16)

Full Changelog: [v0.32.0...v0.33.0](https://github.com/G-Core/gcore-go/compare/v0.32.0...v0.33.0)

### Features

* **api:** aggregated API specs update ([ec94486](https://github.com/G-Core/gcore-go/commit/ec944861160ba13e62af9fd6d69cbd02a0c5988d))
* **api:** aggregated API specs update ([bcc5dd9](https://github.com/G-Core/gcore-go/commit/bcc5dd98f1ec700694a210478b4bc7c09c5e6312))
* **api:** aggregated API specs update ([65027c3](https://github.com/G-Core/gcore-go/commit/65027c3a3e19a40ffd6aab9de27329e3de266585))
* **api:** revert(cdn): remove client_config subresource ([#207](https://github.com/G-Core/gcore-go/issues/207)) ([261e920](https://github.com/G-Core/gcore-go/commit/261e92070411f67fbe0f4494ed808e53db4b84c5))
* **cdn:** add client_config subresource for terraform ([b6a0663](https://github.com/G-Core/gcore-go/commit/b6a06631f9db5e310efbd4bb699448a75655fbd5))


### Bug Fixes

* **cloud:** filter opts in inference deployment polling methods ([5e1ec87](https://github.com/G-Core/gcore-go/commit/5e1ec872443703e46251cbfccf595d9887ef1201))

## 0.32.0 (2026-02-11)

Full Changelog: [v0.31.0...v0.32.0](https://github.com/G-Core/gcore-go/compare/v0.31.0...v0.32.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/G-Core/gcore-go@v0.32.0'
go get -u 'github.com/G-Core/gcore-go@v0.33.0'
```

<!-- x-release-please-end -->
Expand Down
33 changes: 33 additions & 0 deletions cdn/logsuploaderpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ type LogsUploaderPolicy struct {
IncludeEmptyLogs bool `json:"include_empty_logs"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs bool `json:"include_shield_logs"`
// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
// log entries to collect.
//
// - **1** - collect all logs (default).
// - **0.5** - collect approximately 50% of logs.
// - **0** - collect no logs (effectively disables logging without removing the
// policy).
LogSampleRate float64 `json:"log_sample_rate"`
// Name of the policy.
Name string `json:"name"`
// List of logs uploader configs that use this policy.
Expand Down Expand Up @@ -175,6 +183,7 @@ type LogsUploaderPolicy struct {
FormatType respjson.Field
IncludeEmptyLogs respjson.Field
IncludeShieldLogs respjson.Field
LogSampleRate respjson.Field
Name respjson.Field
RelatedUploaderConfigs respjson.Field
RetryIntervalMinutes respjson.Field
Expand Down Expand Up @@ -238,6 +247,14 @@ type LogsUploaderPolicyNewParams struct {
IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
// log entries to collect.
//
// - **1** - collect all logs (default).
// - **0.5** - collect approximately 50% of logs.
// - **0** - collect no logs (effectively disables logging without removing the
// policy).
LogSampleRate param.Opt[float64] `json:"log_sample_rate,omitzero"`
// Name of the policy.
Name param.Opt[string] `json:"name,omitzero"`
// Interval in minutes to retry failed uploads.
Expand Down Expand Up @@ -315,6 +332,14 @@ type LogsUploaderPolicyUpdateParams struct {
IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
// log entries to collect.
//
// - **1** - collect all logs (default).
// - **0.5** - collect approximately 50% of logs.
// - **0** - collect no logs (effectively disables logging without removing the
// policy).
LogSampleRate param.Opt[float64] `json:"log_sample_rate,omitzero"`
// Name of the policy.
Name param.Opt[string] `json:"name,omitzero"`
// Interval in minutes to retry failed uploads.
Expand Down Expand Up @@ -409,6 +434,14 @@ type LogsUploaderPolicyReplaceParams struct {
IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
// log entries to collect.
//
// - **1** - collect all logs (default).
// - **0.5** - collect approximately 50% of logs.
// - **0** - collect no logs (effectively disables logging without removing the
// policy).
LogSampleRate param.Opt[float64] `json:"log_sample_rate,omitzero"`
// Name of the policy.
Name param.Opt[string] `json:"name,omitzero"`
// Interval in minutes to retry failed uploads.
Expand Down
3 changes: 3 additions & 0 deletions cdn/logsuploaderpolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func TestLogsUploaderPolicyNewWithOptionalParams(t *testing.T) {
FormatType: cdn.LogsUploaderPolicyNewParamsFormatTypeJson,
IncludeEmptyLogs: gcore.Bool(true),
IncludeShieldLogs: gcore.Bool(true),
LogSampleRate: gcore.Float(1),
Name: gcore.String("Policy"),
RetryIntervalMinutes: gcore.Int(32),
RotateIntervalMinutes: gcore.Int(32),
Expand Down Expand Up @@ -79,6 +80,7 @@ func TestLogsUploaderPolicyUpdateWithOptionalParams(t *testing.T) {
FormatType: cdn.LogsUploaderPolicyUpdateParamsFormatTypeJson,
IncludeEmptyLogs: gcore.Bool(true),
IncludeShieldLogs: gcore.Bool(true),
LogSampleRate: gcore.Float(0.5),
Name: gcore.String("Policy"),
RetryIntervalMinutes: gcore.Int(32),
RotateIntervalMinutes: gcore.Int(32),
Expand Down Expand Up @@ -213,6 +215,7 @@ func TestLogsUploaderPolicyReplaceWithOptionalParams(t *testing.T) {
FormatType: cdn.LogsUploaderPolicyReplaceParamsFormatTypeJson,
IncludeEmptyLogs: gcore.Bool(true),
IncludeShieldLogs: gcore.Bool(true),
LogSampleRate: gcore.Float(1),
Name: gcore.String("Policy"),
RetryIntervalMinutes: gcore.Int(32),
RotateIntervalMinutes: gcore.Int(32),
Expand Down
3 changes: 3 additions & 0 deletions cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ type BaremetalFlavor struct {
//
// Any of "error", "hide", "show".
PriceStatus BaremetalFlavorPriceStatus `json:"price_status,nullable"`
// Number of available instances of given flavor from reservations
ReservedCapacity int64 `json:"reserved_capacity,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Architecture respjson.Field
Expand All @@ -163,6 +165,7 @@ type BaremetalFlavor struct {
PricePerHour respjson.Field
PricePerMonth respjson.Field
PriceStatus respjson.Field
ReservedCapacity respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
Expand Down
16 changes: 12 additions & 4 deletions cloud/gpubaremetalclusterflavor.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type GPUBaremetalFlavorUnion struct {
// [GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPriceHardwareProperties]
HardwareProperties GPUBaremetalFlavorUnionHardwareProperties `json:"hardware_properties"`
Name string `json:"name"`
ReservedCapacity int64 `json:"reserved_capacity"`
// This field is a union of
// [GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithoutPriceSupportedFeatures],
// [GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPriceSupportedFeatures]
Expand All @@ -92,6 +93,7 @@ type GPUBaremetalFlavorUnion struct {
HardwareDescription respjson.Field
HardwareProperties respjson.Field
Name respjson.Field
ReservedCapacity respjson.Field
SupportedFeatures respjson.Field
Price respjson.Field
raw string
Expand Down Expand Up @@ -188,7 +190,7 @@ func (r *GPUBaremetalFlavorUnionSupportedFeatures) UnmarshalJSON(data []byte) er
type GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithoutPrice struct {
// Flavor architecture type
Architecture string `json:"architecture,required"`
// Number of available instances of given flavor
// Number of available instances of given flavor for the client
Capacity int64 `json:"capacity,required"`
// If the flavor is disabled, new resources cannot be created using this flavor.
Disabled bool `json:"disabled,required"`
Expand All @@ -198,6 +200,8 @@ type GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithoutPrice struct {
HardwareProperties GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithoutPriceHardwareProperties `json:"hardware_properties,required"`
// Flavor name
Name string `json:"name,required"`
// Number of available instances of given flavor from reservations
ReservedCapacity int64 `json:"reserved_capacity,required"`
// Set of enabled features based on the flavor's type and configuration
SupportedFeatures GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithoutPriceSupportedFeatures `json:"supported_features,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
Expand All @@ -208,6 +212,7 @@ type GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithoutPrice struct {
HardwareDescription respjson.Field
HardwareProperties respjson.Field
Name respjson.Field
ReservedCapacity respjson.Field
SupportedFeatures respjson.Field
ExtraFields map[string]respjson.Field
raw string
Expand Down Expand Up @@ -306,18 +311,20 @@ func (r *GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithoutPriceSupportedFeatures
type GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPrice struct {
// Flavor architecture type
Architecture string `json:"architecture,required"`
// Number of available instances of given flavor
// Number of available instances of given flavor for the client
Capacity int64 `json:"capacity,required"`
// If the flavor is disabled, new resources cannot be created using this flavor.
Disabled bool `json:"disabled,required"`
// Additional virtual hardware description
// Additional bare metal hardware description
HardwareDescription GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPriceHardwareDescription `json:"hardware_description,required"`
// Additional bare metal hardware properties
HardwareProperties GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPriceHardwareProperties `json:"hardware_properties,required"`
// Flavor name
Name string `json:"name,required"`
// Flavor price
Price GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPricePrice `json:"price,required"`
// Number of available instances of given flavor from reservations
ReservedCapacity int64 `json:"reserved_capacity,required"`
// Set of enabled features based on the flavor's type and configuration
SupportedFeatures GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPriceSupportedFeatures `json:"supported_features,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
Expand All @@ -329,6 +336,7 @@ type GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPrice struct {
HardwareProperties respjson.Field
Name respjson.Field
Price respjson.Field
ReservedCapacity respjson.Field
SupportedFeatures respjson.Field
ExtraFields map[string]respjson.Field
raw string
Expand All @@ -341,7 +349,7 @@ func (r *GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPrice) UnmarshalJSON(data
return apijson.UnmarshalRoot(data, r)
}

// Additional virtual hardware description
// Additional bare metal hardware description
type GPUBaremetalFlavorBareMetalGPUFlavorsChemaWithPriceHardwareDescription struct {
// Human-readable CPU description
CPU string `json:"cpu,required"`
Expand Down
48 changes: 35 additions & 13 deletions cloud/inferencedeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -2115,13 +2115,14 @@ type InferenceDeploymentStopParams struct {

// NewAndPoll creates a new inference deployment and polls for completion
func (r *InferenceDeploymentService) NewAndPoll(ctx context.Context, params InferenceDeploymentNewParams, opts ...option.RequestOption) (v *InferenceDeployment, err error) {
resource, err := r.New(ctx, params, opts...)
// Exclude WithResponseBodyInto for the action (New returns TaskIDList, must deserialize properly)
actionOpts := requestconfig.ExcludeResponseBodyInto(opts...)
resource, err := r.New(ctx, params, actionOpts...)
if err != nil {
return
}

opts = slices.Concat(r.Options, opts)
precfg, err := requestconfig.PreRequestOptions(opts...)
precfg, err := requestconfig.PreRequestOptions(slices.Concat(r.Options, opts)...)
if err != nil {
return
}
Expand All @@ -2133,7 +2134,12 @@ func (r *InferenceDeploymentService) NewAndPoll(ctx context.Context, params Infe
return nil, errors.New("expected exactly one task to be created")
}
taskID := resource.Tasks[0]
task, err := r.tasks.Poll(ctx, taskID, opts...)
// Exclude WithResponseBodyInto and clear request body for Poll (returns Task, must deserialize properly)
pollOpts := slices.Concat(
requestconfig.ExcludeResponseBodyInto(opts...),
[]option.RequestOption{requestconfig.WithoutRequestBody()},
)
task, err := r.tasks.Poll(ctx, taskID, pollOpts...)
if err != nil {
return
}
Expand All @@ -2143,36 +2149,45 @@ func (r *InferenceDeploymentService) NewAndPoll(ctx context.Context, params Infe
}
resourceID := task.CreatedResources.InferenceInstances[0]

return r.Get(ctx, resourceID, getParams, opts...)
// Clear request body for Get
getOpts := slices.Concat(opts, []option.RequestOption{requestconfig.WithoutRequestBody()})
return r.Get(ctx, resourceID, getParams, getOpts...)
}

// DeleteAndPoll deletes an inference deployment and polls for completion of the first task. Use the [TaskService.Poll]
// method if you need to poll for all tasks.
func (r *InferenceDeploymentService) DeleteAndPoll(ctx context.Context, deploymentName string, params InferenceDeploymentDeleteParams, opts ...option.RequestOption) error {
resource, err := r.Delete(ctx, deploymentName, params, opts...)
// Exclude WithResponseBodyInto for the action (Delete returns TaskIDList, must deserialize properly)
actionOpts := requestconfig.ExcludeResponseBodyInto(opts...)
resource, err := r.Delete(ctx, deploymentName, params, actionOpts...)
if err != nil {
return err
}

opts = slices.Concat(r.Options, opts)
if len(resource.Tasks) == 0 {
return errors.New("expected at least one task to be created")
}
taskID := resource.Tasks[0]
_, err = r.tasks.Poll(ctx, taskID, opts...)
// Exclude WithResponseBodyInto and clear request body for Poll (returns Task, must deserialize properly)
pollOpts := slices.Concat(
requestconfig.ExcludeResponseBodyInto(opts...),
[]option.RequestOption{requestconfig.WithoutRequestBody()},
)
_, err = r.tasks.Poll(ctx, taskID, pollOpts...)
return err
}

// UpdateAndPoll updates an inference deployment and polls for completion of the first task. Use the [TaskService.Poll]
// method if you need to poll for all tasks.
func (r *InferenceDeploymentService) UpdateAndPoll(ctx context.Context, deploymentName string, params InferenceDeploymentUpdateParams, opts ...option.RequestOption) (v *InferenceDeployment, err error) {
resource, err := r.Update(ctx, deploymentName, params, opts...)
// Exclude WithResponseBodyInto for the action (Update returns TaskIDList, must deserialize properly)
actionOpts := requestconfig.ExcludeResponseBodyInto(opts...)
resource, err := r.Update(ctx, deploymentName, params, actionOpts...)
if err != nil {
return
}

opts = slices.Concat(r.Options, opts)
precfg, err := requestconfig.PreRequestOptions(opts...)
precfg, err := requestconfig.PreRequestOptions(slices.Concat(r.Options, opts)...)
if err != nil {
return
}
Expand All @@ -2184,10 +2199,17 @@ func (r *InferenceDeploymentService) UpdateAndPoll(ctx context.Context, deployme
return nil, errors.New("expected at least one task to be created")
}
taskID := resource.Tasks[0]
_, err = r.tasks.Poll(ctx, taskID, opts...)
// Exclude WithResponseBodyInto and clear request body for Poll (returns Task, must deserialize properly)
pollOpts := slices.Concat(
requestconfig.ExcludeResponseBodyInto(opts...),
[]option.RequestOption{requestconfig.WithoutRequestBody()},
)
_, err = r.tasks.Poll(ctx, taskID, pollOpts...)
if err != nil {
return nil, err
}

return r.Get(ctx, deploymentName, getParams, opts...)
// Clear request body for Get
getOpts := slices.Concat(opts, []option.RequestOption{requestconfig.WithoutRequestBody()})
return r.Get(ctx, deploymentName, getParams, getOpts...)
}
18 changes: 18 additions & 0 deletions cloud/securitygrouprule.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ func NewSecurityGroupRuleService(opts ...option.RequestOption) (r SecurityGroupR
}

// Add a new rule to an existing security group.
//
// **Deprecated** Use
// `/v2/security_groups/<project_id>/<region_id>/<group_id>/rules` instead.
//
// Deprecated: deprecated
func (r *SecurityGroupRuleService) New(ctx context.Context, groupID string, params SecurityGroupRuleNewParams, opts ...option.RequestOption) (res *SecurityGroupRule, err error) {
opts = slices.Concat(r.Options, opts)
precfg, err := requestconfig.PreRequestOptions(opts...)
Expand All @@ -61,6 +66,12 @@ func (r *SecurityGroupRuleService) New(ctx context.Context, groupID string, para
}

// Delete a specific rule from a security group.
//
// **Deprecated** Use
// `/v2/security_groups/<project_id>/<region_id>/<group_id>/rules/<rule_id>`
// instead.
//
// Deprecated: deprecated
func (r *SecurityGroupRuleService) Delete(ctx context.Context, ruleID string, body SecurityGroupRuleDeleteParams, opts ...option.RequestOption) (err error) {
opts = slices.Concat(r.Options, opts)
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
Expand Down Expand Up @@ -88,6 +99,13 @@ func (r *SecurityGroupRuleService) Delete(ctx context.Context, ruleID string, bo
}

// Update the configuration of an existing security group rule.
//
// **Deprecated** Use
// `/v2/security_groups/<project_id>/<region_id>/<group_id>/rules/<rule_id>` to
// delete and `/v2/security_groups/<project_id>/<region_id>/<group_id>/rules` to
// create a new rule.
//
// Deprecated: deprecated
func (r *SecurityGroupRuleService) Replace(ctx context.Context, ruleID string, params SecurityGroupRuleReplaceParams, opts ...option.RequestOption) (res *SecurityGroupRule, err error) {
opts = slices.Concat(r.Options, opts)
precfg, err := requestconfig.PreRequestOptions(opts...)
Expand Down
Loading