memos-script/docs/ResourceServiceApi.md

8.8 KiB

memos.ResourceServiceApi

All URIs are relative to /

Method HTTP request Description
resource_service_create_resource POST /api/v2/resources CreateResource creates a new resource.
resource_service_delete_resource DELETE /api/v2/resources/{id} DeleteResource deletes a resource by id.
resource_service_get_resource GET /api/v2/resources/{id} GetResource returns a resource by id.
resource_service_get_resource_by_name GET /api/v2/resources/name/{name} GetResourceByName returns a resource by name.
resource_service_list_resources GET /api/v2/resources ListResources lists all resources.
resource_service_update_resource PATCH /api/v2/resources/{resource.id} UpdateResource updates a resource.

resource_service_create_resource

V2CreateResourceResponse resource_service_create_resource(filename=filename, external_link=external_link, type=type, memo_id=memo_id)

CreateResource creates a new resource.

Example

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()
filename = 'filename_example' # str |  (optional)
external_link = 'external_link_example' # str |  (optional)
type = 'type_example' # str |  (optional)
memo_id = 56 # int |  (optional)

try:
    # CreateResource creates a new resource.
    api_response = api_instance.resource_service_create_resource(filename=filename, external_link=external_link, type=type, memo_id=memo_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourceServiceApi->resource_service_create_resource: %s\n" % e)

Parameters

Name Type Description Notes
filename str [optional]
external_link str [optional]
type str [optional]
memo_id int [optional]

Return type

V2CreateResourceResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

resource_service_delete_resource

V2DeleteResourceResponse resource_service_delete_resource(id)

DeleteResource deletes a resource by id.

Example

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()
id = 56 # int | 

try:
    # DeleteResource deletes a resource by id.
    api_response = api_instance.resource_service_delete_resource(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourceServiceApi->resource_service_delete_resource: %s\n" % e)

Parameters

Name Type Description Notes
id int

Return type

V2DeleteResourceResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

resource_service_get_resource

V2GetResourceResponse resource_service_get_resource(id)

GetResource returns a resource by id.

Example

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()
id = 56 # int | 

try:
    # GetResource returns a resource by id.
    api_response = api_instance.resource_service_get_resource(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourceServiceApi->resource_service_get_resource: %s\n" % e)

Parameters

Name Type Description Notes
id int

Return type

V2GetResourceResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

resource_service_get_resource_by_name

V2GetResourceByNameResponse resource_service_get_resource_by_name(name)

GetResourceByName returns a resource by name.

Example

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 = 'name_example' # str | 

try:
    # GetResourceByName returns a resource by name.
    api_response = api_instance.resource_service_get_resource_by_name(name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ResourceServiceApi->resource_service_get_resource_by_name: %s\n" % e)

Parameters

Name Type Description Notes
name str

Return type

V2GetResourceByNameResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

resource_service_list_resources

V2ListResourcesResponse resource_service_list_resources()

ListResources lists all resources.

Example

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

V2ListResourcesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

resource_service_update_resource

V2UpdateResourceResponse resource_service_update_resource(body, resource_id)

UpdateResource updates a resource.

Example

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.ResourcesResourceIdBody() # ResourcesResourceIdBody | 
resource_id = 56 # int | id is the system generated unique identifier.

try:
    # UpdateResource updates a resource.
    api_response = api_instance.resource_service_update_resource(body, resource_id)
    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 ResourcesResourceIdBody
resource_id int id is the system generated unique identifier.

Return type

V2UpdateResourceResponse

Authorization

No authorization required

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]