Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added OperationIDs to TPR spec and regenerated the client #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2017
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
5 changes: 5 additions & 0 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,11 @@ Class | Method | HTTP request | Description
*StorageV1beta1Api* | [**patch_storage_class**](docs/StorageV1beta1Api.md#patch_storage_class) | **PATCH** /apis/storage.k8s.io/v1beta1/storageclasses/{name} |
*StorageV1beta1Api* | [**read_storage_class**](docs/StorageV1beta1Api.md#read_storage_class) | **GET** /apis/storage.k8s.io/v1beta1/storageclasses/{name} |
*StorageV1beta1Api* | [**replace_storage_class**](docs/StorageV1beta1Api.md#replace_storage_class) | **PUT** /apis/storage.k8s.io/v1beta1/storageclasses/{name} |
*ThirdPartyResourcesApi* | [**create_third_party_resource**](docs/ThirdPartyResourcesApi.md#create_third_party_resource) | **POST** /apis/{fqdn}/v1/namespaces/{namespace}/{resource} | Create a Resource
*ThirdPartyResourcesApi* | [**delete_third_party_resource**](docs/ThirdPartyResourcesApi.md#delete_third_party_resource) | **DELETE** /apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name} | Deletes a specific Resource
*ThirdPartyResourcesApi* | [**get_third_party_resource**](docs/ThirdPartyResourcesApi.md#get_third_party_resource) | **GET** /apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name} | Gets a specific Resource
*ThirdPartyResourcesApi* | [**list_third_party_resource**](docs/ThirdPartyResourcesApi.md#list_third_party_resource) | **GET** /apis/{fqdn}/v1/{resource} | Gets Resources
*ThirdPartyResourcesApi* | [**update_third_party_resource**](docs/ThirdPartyResourcesApi.md#update_third_party_resource) | **PUT** /apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name} | Update a Resource
*VersionApi* | [**get_code**](docs/VersionApi.md#get_code) | **GET** /version/ |


Expand Down
1 change: 1 addition & 0 deletions kubernetes/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@
from .apis.storage_api import StorageApi
from .apis.storage_v1_api import StorageV1Api
from .apis.storage_v1beta1_api import StorageV1beta1Api
from .apis.third_party_resources_api import ThirdPartyResourcesApi
from .apis.version_api import VersionApi

# import ApiClient
Expand Down
1 change: 1 addition & 0 deletions kubernetes/client/apis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
from .storage_api import StorageApi
from .storage_v1_api import StorageV1Api
from .storage_v1beta1_api import StorageV1beta1Api
from .third_party_resources_api import ThirdPartyResourcesApi
from .version_api import VersionApi
622 changes: 622 additions & 0 deletions kubernetes/client/apis/third_party_resources_api.py

Large diffs are not rendered by default.

281 changes: 281 additions & 0 deletions kubernetes/docs/ThirdPartyResourcesApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
# kubernetes.client.ThirdPartyResourcesApi

All URIs are relative to *https://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_third_party_resource**](ThirdPartyResourcesApi.md#create_third_party_resource) | **POST** /apis/{fqdn}/v1/namespaces/{namespace}/{resource} | Create a Resource
[**delete_third_party_resource**](ThirdPartyResourcesApi.md#delete_third_party_resource) | **DELETE** /apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name} | Deletes a specific Resource
[**get_third_party_resource**](ThirdPartyResourcesApi.md#get_third_party_resource) | **GET** /apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name} | Gets a specific Resource
[**list_third_party_resource**](ThirdPartyResourcesApi.md#list_third_party_resource) | **GET** /apis/{fqdn}/v1/{resource} | Gets Resources
[**update_third_party_resource**](ThirdPartyResourcesApi.md#update_third_party_resource) | **PUT** /apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name} | Update a Resource


# **create_third_party_resource**
> object create_third_party_resource(namespace, fqdn, resource, body)

Create a Resource

Creates a third party resource of the type specified

### Example
```python
from __future__ import print_statement
import time
import kubernetes.client
from kubernetes.client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = kubernetes.client.ThirdPartyResourcesApi()
namespace = 'namespace_example' # str | The Resource's namespace
fqdn = 'fqdn_example' # str | The Third party Resource fqdn
resource = 'resource_example' # str | The Resource type
body = NULL # object | The JSON schema of the Resource to create.

try:
# Create a Resource
api_response = api_instance.create_third_party_resource(namespace, fqdn, resource, body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ThirdPartyResourcesApi->create_third_party_resource: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | **str**| The Resource's namespace |
**fqdn** | **str**| The Third party Resource fqdn |
**resource** | **str**| The Resource type |
**body** | **object**| The JSON schema of the Resource to create. |

### Return type

**object**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)

# **delete_third_party_resource**
> object delete_third_party_resource(body, grace_period_seconds=grace_period_seconds, orphan_dependents=orphan_dependents, propagation_policy=propagation_policy)

Deletes a specific Resource

Deletes the specified Resource in the specified namespace

### Example
```python
from __future__ import print_statement
import time
import kubernetes.client
from kubernetes.client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = kubernetes.client.ThirdPartyResourcesApi()
body = kubernetes.client.V1DeleteOptions() # V1DeleteOptions |
grace_period_seconds = 56 # int | The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. (optional)
orphan_dependents = true # bool | Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. (optional)
propagation_policy = 'propagation_policy_example' # str | Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. (optional)

try:
# Deletes a specific Resource
api_response = api_instance.delete_third_party_resource(body, grace_period_seconds=grace_period_seconds, orphan_dependents=orphan_dependents, propagation_policy=propagation_policy)
pprint(api_response)
except ApiException as e:
print("Exception when calling ThirdPartyResourcesApi->delete_third_party_resource: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**V1DeleteOptions**](V1DeleteOptions.md)| |
**grace_period_seconds** | **int**| The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately. | [optional]
**orphan_dependents** | **bool**| Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both. | [optional]
**propagation_policy** | **str**| Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. | [optional]

### Return type

**object**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)

# **get_third_party_resource**
> object get_third_party_resource(namespace, name, fqdn, resource)

Gets a specific Resource

Returns a specific Resource in a namespace

### Example
```python
from __future__ import print_statement
import time
import kubernetes.client
from kubernetes.client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = kubernetes.client.ThirdPartyResourcesApi()
namespace = 'namespace_example' # str | The Resource's namespace
name = 'name_example' # str | The Resource's name
fqdn = 'fqdn_example' # str | The Third party Resource fqdn
resource = 'resource_example' # str | The Resource type

try:
# Gets a specific Resource
api_response = api_instance.get_third_party_resource(namespace, name, fqdn, resource)
pprint(api_response)
except ApiException as e:
print("Exception when calling ThirdPartyResourcesApi->get_third_party_resource: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | **str**| The Resource's namespace |
**name** | **str**| The Resource's name |
**fqdn** | **str**| The Third party Resource fqdn |
**resource** | **str**| The Resource type |

### Return type

**object**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)

# **list_third_party_resource**
> object list_third_party_resource(fqdn, resource, watch=watch)

Gets Resources

Returns a list of Resources

### Example
```python
from __future__ import print_statement
import time
import kubernetes.client
from kubernetes.client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = kubernetes.client.ThirdPartyResourcesApi()
fqdn = 'fqdn_example' # str | The Third party Resource fqdn
resource = 'resource_example' # str | The Resource type
watch = true # bool | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. (optional)

try:
# Gets Resources
api_response = api_instance.list_third_party_resource(fqdn, resource, watch=watch)
pprint(api_response)
except ApiException as e:
print("Exception when calling ThirdPartyResourcesApi->list_third_party_resource: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**fqdn** | **str**| The Third party Resource fqdn |
**resource** | **str**| The Resource type |
**watch** | **bool**| Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. | [optional]

### Return type

**object**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)

# **update_third_party_resource**
> object update_third_party_resource(namespace, fqdn, resource, body)

Update a Resource

Update the specified third party resource of the type specified

### Example
```python
from __future__ import print_statement
import time
import kubernetes.client
from kubernetes.client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = kubernetes.client.ThirdPartyResourcesApi()
namespace = 'namespace_example' # str | The Resource's namespace
fqdn = 'fqdn_example' # str | The Third party Resource fqdn
resource = 'resource_example' # str | The Resource type
body = NULL # object | The JSON schema of the Resource to create.

try:
# Update a Resource
api_response = api_instance.update_third_party_resource(namespace, fqdn, resource, body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ThirdPartyResourcesApi->update_third_party_resource: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**namespace** | **str**| The Resource's namespace |
**fqdn** | **str**| The Third party Resource fqdn |
**resource** | **str**| The Resource type |
**body** | **object**| The JSON schema of the Resource to create. |

### Return type

**object**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)

76 changes: 76 additions & 0 deletions kubernetes/test/test_third_party_resources_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# coding: utf-8

"""
Kubernetes

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: v1.6.3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import os
import sys
import unittest

import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.apis.third_party_resources_api import ThirdPartyResourcesApi


class TestThirdPartyResourcesApi(unittest.TestCase):
""" ThirdPartyResourcesApi unit test stubs """

def setUp(self):
self.api = kubernetes.client.apis.third_party_resources_api.ThirdPartyResourcesApi()

def tearDown(self):
pass

def test_create_third_party_resource(self):
"""
Test case for create_third_party_resource

Create a Resource
"""
pass

def test_delete_third_party_resource(self):
"""
Test case for delete_third_party_resource

Deletes a specific Resource
"""
pass

def test_get_third_party_resource(self):
"""
Test case for get_third_party_resource

Gets a specific Resource
"""
pass

def test_list_third_party_resource(self):
"""
Test case for list_third_party_resource

Gets Resources
"""
pass

def test_update_third_party_resource(self):
"""
Test case for update_third_party_resource

Update a Resource
"""
pass


if __name__ == '__main__':
unittest.main()
Loading