Skip to content

Commit

Permalink
feat: add dataset update
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusbakunas committed Aug 7, 2021
1 parent 1d2b7cb commit 33630c6
Show file tree
Hide file tree
Showing 8 changed files with 1,336 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ docs/Pool.md
docs/PoolApi.md
docs/Service.md
docs/ServiceApi.md
docs/UpdateDatasetParams.md
git_push.sh
go.mod
go.sum
Expand All @@ -32,5 +33,6 @@ model_cron_job_schedule.go
model_dataset.go
model_pool.go
model_service.go
model_update_dataset_params.go
response.go
utils.go
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Class | Method | HTTP request | Description
*CronjobApi* | [**UpdateCronJob**](docs/CronjobApi.md#updatecronjob) | **Put** /cronjob/id/{id} |
*DatasetApi* | [**CreateDataset**](docs/DatasetApi.md#createdataset) | **Post** /pool/dataset |
*DatasetApi* | [**GetDataset**](docs/DatasetApi.md#getdataset) | **Get** /pool/dataset/id/{id} |
*DatasetApi* | [**UpdateDataset**](docs/DatasetApi.md#updatedataset) | **Put** /pool/dataset/id/{id} |
*PoolApi* | [**ListPools**](docs/PoolApi.md#listpools) | **Get** /pool |
*ServiceApi* | [**GetService**](docs/ServiceApi.md#getservice) | **Get** /service/id/{id} |

Expand All @@ -99,6 +100,7 @@ Class | Method | HTTP request | Description
- [Dataset](docs/Dataset.md)
- [Pool](docs/Pool.md)
- [Service](docs/Service.md)
- [UpdateDatasetParams](docs/UpdateDatasetParams.md)


## Documentation For Authorization
Expand Down
75 changes: 75 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,35 @@ paths:
- bearerAuth: []
tags:
- dataset
put:
description: Update dataset
operationId: updateDataset
parameters:
- explode: false
in: path
name: id
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateDatasetParams'
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Dataset'
description: Dataset details
"401":
description: No authorization for this endpoint
security:
- bearerAuth: []
tags:
- dataset
/cronjob/id/{id}:
delete:
operationId: deleteCronJob
Expand Down Expand Up @@ -468,6 +497,52 @@ components:
required:
- name
type: object
UpdateDatasetParams:
example:
atime: atime
comments: comments
recordsize: recordsize
deduplication: deduplication
refreservation: 1
sync: sync
snapdir: snapdir
copies: 0
readonly: readonly
quota: quota
aclmode: aclmode
compression: compression
refquota: 6
exec: exec
properties:
atime:
type: string
aclmode:
type: string
comments:
type: string
compression:
type: string
copies:
type: integer
deduplication:
type: string
exec:
type: string
quota:
type: string
readonly:
type: string
recordsize:
type: string
refquota:
type: integer
refreservation:
type: integer
snapdir:
type: string
sync:
type: string
type: object
CompositeValue:
example:
rawvalue: rawvalue
Expand Down
113 changes: 113 additions & 0 deletions api_dataset.go

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

58 changes: 58 additions & 0 deletions cfg/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,33 @@ paths:
$ref: '#/components/schemas/Dataset'
'401':
$ref: '#/components/responses/Unauthorized'
put:
tags:
- dataset
operationId: updateDataset
security:
- bearerAuth: [ ]
description: Update dataset
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateDatasetParams'
responses:
'200':
description: 'Dataset details'
content:
application/json:
schema:
$ref: '#/components/schemas/Dataset'
'401':
$ref: '#/components/responses/Unauthorized'
/cronjob/id/{id}:
get:
tags:
Expand Down Expand Up @@ -389,6 +416,37 @@ components:
type: string
type:
type: string
UpdateDatasetParams:
type: object
properties:
atime:
type: string
aclmode:
type: string
comments:
type: string
compression:
type: string
copies:
type: integer
deduplication:
type: string
exec:
type: string
quota:
type: string
readonly:
type: string
recordsize:
type: string
refquota:
type: integer
refreservation:
type: integer
snapdir:
type: string
sync:
type: string
CompositeValue:
type: object
required:
Expand Down
73 changes: 73 additions & 0 deletions docs/DatasetApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**CreateDataset**](DatasetApi.md#CreateDataset) | **Post** /pool/dataset |
[**GetDataset**](DatasetApi.md#GetDataset) | **Get** /pool/dataset/id/{id} |
[**UpdateDataset**](DatasetApi.md#UpdateDataset) | **Put** /pool/dataset/id/{id} |



Expand Down Expand Up @@ -152,3 +153,75 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)


## UpdateDataset

> Dataset UpdateDataset(ctx, id).UpdateDatasetParams(updateDatasetParams).Execute()




### Example

```go
package main

import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)

func main() {
id := "id_example" // string |
updateDatasetParams := *openapiclient.NewUpdateDatasetParams() // UpdateDatasetParams | (optional)

configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.DatasetApi.UpdateDataset(context.Background(), id).UpdateDatasetParams(updateDatasetParams).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DatasetApi.UpdateDataset``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateDataset`: Dataset
fmt.Fprintf(os.Stdout, "Response from `DatasetApi.UpdateDataset`: %v\n", resp)
}
```

### Path Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | |

### Other Parameters

Other parameters are passed through a pointer to a apiUpdateDatasetRequest struct via the builder pattern


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------

**updateDatasetParams** | [**UpdateDatasetParams**](UpdateDatasetParams.md) | |

### Return type

[**Dataset**](Dataset.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

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

Loading

0 comments on commit 33630c6

Please sign in to comment.