Skip to content

Commit

Permalink
Support UpdateStrategy and DeleteOption
Browse files Browse the repository at this point in the history
Signed-off-by: clyang82 <[email protected]>
  • Loading branch information
clyang82 committed May 23, 2024
1 parent 5a3ead6 commit a3c8bcd
Show file tree
Hide file tree
Showing 15 changed files with 480 additions and 49 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ ocm post /api/maestro/v1/resources << EOF
}
}
}
},
"update_strategy": {
"type": "Orphan"
},
"delete_option": {
"propagationPolicy": "CreateOnly"
}
}
EOF
Expand Down
4 changes: 2 additions & 2 deletions data/generated/openapi/openapi.go

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,10 @@ components:
format: date-time
manifest:
type: object
delete_option:
type: object
update_strategy:
type: object
status:
type: object
ResourceList:
Expand All @@ -527,6 +531,10 @@ components:
type: integer
manifest:
type: object
delete_option:
type: object
update_strategy:
type: object
Consumer:
allOf:
- $ref: '#/components/schemas/ObjectReference'
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/openapi/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -774,13 +774,19 @@ components:
- $ref: '#/components/schemas/ResourceList_allOf'
ResourcePatchRequest:
example:
delete_option: "{}"
update_strategy: "{}"
manifest: "{}"
version: 0
properties:
version:
type: integer
manifest:
type: object
delete_option:
type: object
update_strategy:
type: object
type: object
Consumer:
allOf:
Expand Down Expand Up @@ -834,6 +840,10 @@ components:
type: string
manifest:
type: object
delete_option:
type: object
update_strategy:
type: object
status:
type: object
type: object
Expand Down
52 changes: 52 additions & 0 deletions pkg/api/openapi/docs/Resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Name | Type | Description | Notes
**CreatedAt** | Pointer to **time.Time** | | [optional]
**UpdatedAt** | Pointer to **time.Time** | | [optional]
**Manifest** | Pointer to **map[string]interface{}** | | [optional]
**DeleteOption** | Pointer to **map[string]interface{}** | | [optional]
**UpdateStrategy** | Pointer to **map[string]interface{}** | | [optional]
**Status** | Pointer to **map[string]interface{}** | | [optional]

## Methods
Expand Down Expand Up @@ -259,6 +261,56 @@ SetManifest sets Manifest field to given value.

HasManifest returns a boolean if a field has been set.

### GetDeleteOption

`func (o *Resource) GetDeleteOption() map[string]interface{}`

GetDeleteOption returns the DeleteOption field if non-nil, zero value otherwise.

### GetDeleteOptionOk

`func (o *Resource) GetDeleteOptionOk() (*map[string]interface{}, bool)`

GetDeleteOptionOk returns a tuple with the DeleteOption field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetDeleteOption

`func (o *Resource) SetDeleteOption(v map[string]interface{})`

SetDeleteOption sets DeleteOption field to given value.

### HasDeleteOption

`func (o *Resource) HasDeleteOption() bool`

HasDeleteOption returns a boolean if a field has been set.

### GetUpdateStrategy

`func (o *Resource) GetUpdateStrategy() map[string]interface{}`

GetUpdateStrategy returns the UpdateStrategy field if non-nil, zero value otherwise.

### GetUpdateStrategyOk

`func (o *Resource) GetUpdateStrategyOk() (*map[string]interface{}, bool)`

GetUpdateStrategyOk returns a tuple with the UpdateStrategy field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetUpdateStrategy

`func (o *Resource) SetUpdateStrategy(v map[string]interface{})`

SetUpdateStrategy sets UpdateStrategy field to given value.

### HasUpdateStrategy

`func (o *Resource) HasUpdateStrategy() bool`

HasUpdateStrategy returns a boolean if a field has been set.

### GetStatus

`func (o *Resource) GetStatus() map[string]interface{}`
Expand Down
52 changes: 52 additions & 0 deletions pkg/api/openapi/docs/ResourceAllOf.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Name | Type | Description | Notes
**CreatedAt** | Pointer to **time.Time** | | [optional]
**UpdatedAt** | Pointer to **time.Time** | | [optional]
**Manifest** | Pointer to **map[string]interface{}** | | [optional]
**DeleteOption** | Pointer to **map[string]interface{}** | | [optional]
**UpdateStrategy** | Pointer to **map[string]interface{}** | | [optional]
**Status** | Pointer to **map[string]interface{}** | | [optional]

## Methods
Expand Down Expand Up @@ -181,6 +183,56 @@ SetManifest sets Manifest field to given value.

HasManifest returns a boolean if a field has been set.

### GetDeleteOption

`func (o *ResourceAllOf) GetDeleteOption() map[string]interface{}`

GetDeleteOption returns the DeleteOption field if non-nil, zero value otherwise.

### GetDeleteOptionOk

`func (o *ResourceAllOf) GetDeleteOptionOk() (*map[string]interface{}, bool)`

GetDeleteOptionOk returns a tuple with the DeleteOption field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetDeleteOption

`func (o *ResourceAllOf) SetDeleteOption(v map[string]interface{})`

SetDeleteOption sets DeleteOption field to given value.

### HasDeleteOption

`func (o *ResourceAllOf) HasDeleteOption() bool`

HasDeleteOption returns a boolean if a field has been set.

### GetUpdateStrategy

`func (o *ResourceAllOf) GetUpdateStrategy() map[string]interface{}`

GetUpdateStrategy returns the UpdateStrategy field if non-nil, zero value otherwise.

### GetUpdateStrategyOk

`func (o *ResourceAllOf) GetUpdateStrategyOk() (*map[string]interface{}, bool)`

GetUpdateStrategyOk returns a tuple with the UpdateStrategy field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetUpdateStrategy

`func (o *ResourceAllOf) SetUpdateStrategy(v map[string]interface{})`

SetUpdateStrategy sets UpdateStrategy field to given value.

### HasUpdateStrategy

`func (o *ResourceAllOf) HasUpdateStrategy() bool`

HasUpdateStrategy returns a boolean if a field has been set.

### GetStatus

`func (o *ResourceAllOf) GetStatus() map[string]interface{}`
Expand Down
52 changes: 52 additions & 0 deletions pkg/api/openapi/docs/ResourcePatchRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Version** | Pointer to **int32** | | [optional]
**Manifest** | Pointer to **map[string]interface{}** | | [optional]
**DeleteOption** | Pointer to **map[string]interface{}** | | [optional]
**UpdateStrategy** | Pointer to **map[string]interface{}** | | [optional]

## Methods

Expand Down Expand Up @@ -76,6 +78,56 @@ SetManifest sets Manifest field to given value.

HasManifest returns a boolean if a field has been set.

### GetDeleteOption

`func (o *ResourcePatchRequest) GetDeleteOption() map[string]interface{}`

GetDeleteOption returns the DeleteOption field if non-nil, zero value otherwise.

### GetDeleteOptionOk

`func (o *ResourcePatchRequest) GetDeleteOptionOk() (*map[string]interface{}, bool)`

GetDeleteOptionOk returns a tuple with the DeleteOption field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetDeleteOption

`func (o *ResourcePatchRequest) SetDeleteOption(v map[string]interface{})`

SetDeleteOption sets DeleteOption field to given value.

### HasDeleteOption

`func (o *ResourcePatchRequest) HasDeleteOption() bool`

HasDeleteOption returns a boolean if a field has been set.

### GetUpdateStrategy

`func (o *ResourcePatchRequest) GetUpdateStrategy() map[string]interface{}`

GetUpdateStrategy returns the UpdateStrategy field if non-nil, zero value otherwise.

### GetUpdateStrategyOk

`func (o *ResourcePatchRequest) GetUpdateStrategyOk() (*map[string]interface{}, bool)`

GetUpdateStrategyOk returns a tuple with the UpdateStrategy field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetUpdateStrategy

`func (o *ResourcePatchRequest) SetUpdateStrategy(v map[string]interface{})`

SetUpdateStrategy sets UpdateStrategy field to given value.

### HasUpdateStrategy

`func (o *ResourcePatchRequest) HasUpdateStrategy() bool`

HasUpdateStrategy returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
92 changes: 82 additions & 10 deletions pkg/api/openapi/model_resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a3c8bcd

Please sign in to comment.