halo_client.PostV1alpha1UcApi
All URIs are relative to http://localhost:8091
| Method | HTTP request | Description |
|---|---|---|
| create_my_post | POST /apis/uc.api.content.halo.run/v1alpha1/posts | |
| get_my_post | GET /apis/uc.api.content.halo.run/v1alpha1/posts/{name} | |
| get_my_post_draft | GET /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/draft | |
| list_my_posts | GET /apis/uc.api.content.halo.run/v1alpha1/posts | |
| publish_my_post | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/publish | |
| recycle_my_post | DELETE /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/recycle | |
| unpublish_my_post | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/unpublish | |
| update_my_post | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name} | |
| update_my_post_draft | PUT /apis/uc.api.content.halo.run/v1alpha1/posts/{name}/draft |
create_my_post
Post create_my_post(post=post)
Create my post. If you want to create a post with content, please set annotation: "content.halo.run/content-json" into annotations and refer to Content for corresponding data type.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.post import Post from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) post = halo_client.Post() # Post | (optional) try: api_response = api_instance.create_my_post(post=post) print("The response of PostV1alpha1UcApi->create_my_post:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->create_my_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| post | Post | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_my_post
Post get_my_post(name)
Get post that belongs to the current user.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.post import Post from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) name = 'name_example' # str | Post name try: api_response = api_instance.get_my_post(name) print("The response of PostV1alpha1UcApi->get_my_post:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->get_my_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Post name |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_my_post_draft
Snapshot get_my_post_draft(name, patched=patched)
Get my post draft.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.snapshot import Snapshot from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) name = 'name_example' # str | Post name patched = True # bool | Should include patched content and raw or not. (optional) try: api_response = api_instance.get_my_post_draft(name, patched=patched) print("The response of PostV1alpha1UcApi->get_my_post_draft:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->get_my_post_draft: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Post name | |
| patched | bool | Should include patched content and raw or not. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list_my_posts
ListedPostList list_my_posts(page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort, publish_phase=publish_phase, keyword=keyword, category_with_children=category_with_children)
List posts owned by the current user.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.listed_post_list import ListedPostList from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) page = 56 # int | Page number. Default is 0. (optional) size = 56 # int | Size number. Default is 0. (optional) label_selector = ['label_selector_example'] # List[str] | Label selector. e.g.: hidden!=true (optional) field_selector = ['field_selector_example'] # List[str] | Field selector. e.g.: metadata.name==halo (optional) sort = ['sort_example'] # List[str] | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. (optional) publish_phase = 'publish_phase_example' # str | Posts filtered by publish phase. (optional) keyword = 'keyword_example' # str | Posts filtered by keyword. (optional) category_with_children = 'category_with_children_example' # str | Posts filtered by category including sub-categories. (optional) try: api_response = api_instance.list_my_posts(page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort, publish_phase=publish_phase, keyword=keyword, category_with_children=category_with_children) print("The response of PostV1alpha1UcApi->list_my_posts:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->list_my_posts: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| page | int | Page number. Default is 0. | [optional] |
| size | int | Size number. Default is 0. | [optional] |
| label_selector | List[str] | Label selector. e.g.: hidden!=true | [optional] |
| field_selector | List[str] | Field selector. e.g.: metadata.name==halo | [optional] |
| sort | List[str] | Sorting criteria in the format: property,(asc | desc). Default sort order is ascending. Multiple sort criteria are supported. |
| publish_phase | str | Posts filtered by publish phase. | [optional] |
| keyword | str | Posts filtered by keyword. | [optional] |
| category_with_children | str | Posts filtered by category including sub-categories. | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
publish_my_post
Post publish_my_post(name)
Publish my post.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.post import Post from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) name = 'name_example' # str | Post name try: api_response = api_instance.publish_my_post(name) print("The response of PostV1alpha1UcApi->publish_my_post:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->publish_my_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Post name |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
recycle_my_post
Post recycle_my_post(name)
Move my post to recycle bin.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.post import Post from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) name = 'name_example' # str | Post name try: api_response = api_instance.recycle_my_post(name) print("The response of PostV1alpha1UcApi->recycle_my_post:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->recycle_my_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Post name |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
unpublish_my_post
Post unpublish_my_post(name)
Unpublish my post.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.post import Post from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) name = 'name_example' # str | Post name try: api_response = api_instance.unpublish_my_post(name) print("The response of PostV1alpha1UcApi->unpublish_my_post:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->unpublish_my_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Post name |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_my_post
Post update_my_post(name, post=post)
Update my post.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.post import Post from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) name = 'name_example' # str | Post name post = halo_client.Post() # Post | (optional) try: api_response = api_instance.update_my_post(name, post=post) print("The response of PostV1alpha1UcApi->update_my_post:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->update_my_post: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Post name | |
| post | Post | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_my_post_draft
Snapshot update_my_post_draft(name, snapshot=snapshot)
Update draft of my post. Please make sure set annotation: "content.halo.run/content-json" into annotations and refer to Content for corresponding data type.
Example
- Basic Authentication (basicAuth):
- Bearer (JWT) Authentication (bearerAuth):
import halo_client from halo_client.models.snapshot import Snapshot from halo_client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost:8091 # See configuration.py for a list of all supported configuration parameters. configuration = halo_client.Configuration( host = "http://localhost:8091" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: basicAuth configuration = halo_client.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) # Configure Bearer authorization (JWT): bearerAuth configuration = halo_client.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with halo_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = halo_client.PostV1alpha1UcApi(api_client) name = 'name_example' # str | Post name snapshot = halo_client.Snapshot() # Snapshot | (optional) try: api_response = api_instance.update_my_post_draft(name, snapshot=snapshot) print("The response of PostV1alpha1UcApi->update_my_post_draft:\n") pprint(api_response) except Exception as e: print("Exception when calling PostV1alpha1UcApi->update_my_post_draft: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | Post name | |
| snapshot | Snapshot | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: /
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 0 | default response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]