memos-script/docs/ResourceServiceApi.md
2024-04-30 10:31:09 +08:00

288 lines
8.7 KiB
Markdown

# memos.ResourceServiceApi
All URIs are relative to */*
Method | HTTP request | Description
------------- | ------------- | -------------
[**resource_service_create_resource**](ResourceServiceApi.md#resource_service_create_resource) | **POST** /api/v1/resources | CreateResource creates a new resource.
[**resource_service_delete_resource**](ResourceServiceApi.md#resource_service_delete_resource) | **DELETE** /api/v1/{name_3} | DeleteResource deletes a resource by name.
[**resource_service_get_resource**](ResourceServiceApi.md#resource_service_get_resource) | **GET** /api/v1/{name_2} | GetResource returns a resource by name.
[**resource_service_list_resources**](ResourceServiceApi.md#resource_service_list_resources) | **GET** /api/v1/resources | ListResources lists all resources.
[**resource_service_search_resources**](ResourceServiceApi.md#resource_service_search_resources) | **GET** /api/v1/resources:search | SearchResources searches memos.
[**resource_service_update_resource**](ResourceServiceApi.md#resource_service_update_resource) | **PATCH** /api/v1/{resource.name} | UpdateResource updates a resource.
# **resource_service_create_resource**
> V1Resource resource_service_create_resource(body)
CreateResource creates a new resource.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.ResourceServiceApi()
body = memos.V1Resource() # V1Resource |
try:
# CreateResource creates a new resource.
api_response = api_instance.resource_service_create_resource(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ResourceServiceApi->resource_service_create_resource: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**V1Resource**](V1Resource.md)| |
### Return type
[**V1Resource**](V1Resource.md)
### Authorization
No authorization required
### 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)
# **resource_service_delete_resource**
> object resource_service_delete_resource(name_3)
DeleteResource deletes a resource by name.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.ResourceServiceApi()
name_3 = 'name_3_example' # str | The name of the resource. Format: resources/{id} id is the system generated unique identifier.
try:
# DeleteResource deletes a resource by name.
api_response = api_instance.resource_service_delete_resource(name_3)
pprint(api_response)
except ApiException as e:
print("Exception when calling ResourceServiceApi->resource_service_delete_resource: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name_3** | **str**| The name of the resource. Format: resources/{id} id is the system generated unique identifier. |
### Return type
**object**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **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)
# **resource_service_get_resource**
> V1Resource resource_service_get_resource(name_2)
GetResource returns a resource by name.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.ResourceServiceApi()
name_2 = 'name_2_example' # str | The name of the resource. Format: resources/{id} id is the system generated unique identifier.
try:
# GetResource returns a resource by name.
api_response = api_instance.resource_service_get_resource(name_2)
pprint(api_response)
except ApiException as e:
print("Exception when calling ResourceServiceApi->resource_service_get_resource: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name_2** | **str**| The name of the resource. Format: resources/{id} id is the system generated unique identifier. |
### Return type
[**V1Resource**](V1Resource.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **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)
# **resource_service_list_resources**
> V1ListResourcesResponse resource_service_list_resources()
ListResources lists all resources.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.ResourceServiceApi()
try:
# ListResources lists all resources.
api_response = api_instance.resource_service_list_resources()
pprint(api_response)
except ApiException as e:
print("Exception when calling ResourceServiceApi->resource_service_list_resources: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**V1ListResourcesResponse**](V1ListResourcesResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **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)
# **resource_service_search_resources**
> V1SearchResourcesResponse resource_service_search_resources(filter=filter)
SearchResources searches memos.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.ResourceServiceApi()
filter = 'filter_example' # str | (optional)
try:
# SearchResources searches memos.
api_response = api_instance.resource_service_search_resources(filter=filter)
pprint(api_response)
except ApiException as e:
print("Exception when calling ResourceServiceApi->resource_service_search_resources: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**filter** | **str**| | [optional]
### Return type
[**V1SearchResourcesResponse**](V1SearchResourcesResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **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)
# **resource_service_update_resource**
> V1Resource resource_service_update_resource(body, resource_name)
UpdateResource updates a resource.
### Example
```python
from __future__ import print_function
import time
import memos
from memos.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = memos.ResourceServiceApi()
body = memos.V1ResourceNameBody() # V1ResourceNameBody |
resource_name = 'resource_name_example' # str | The name of the resource. Format: resources/{id} id is the system generated unique identifier.
try:
# UpdateResource updates a resource.
api_response = api_instance.resource_service_update_resource(body, resource_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ResourceServiceApi->resource_service_update_resource: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**V1ResourceNameBody**](V1ResourceNameBody.md)| |
**resource_name** | **str**| The name of the resource. Format: resources/{id} id is the system generated unique identifier. |
### Return type
[**V1Resource**](V1Resource.md)
### Authorization
No authorization required
### 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)