Skip to content

Latest commit

 

History

History
275 lines (196 loc) · 10.1 KB

File metadata and controls

275 lines (196 loc) · 10.1 KB

halo_client.CategoryV1alpha1PublicApi

All URIs are relative to http://localhost:8091

Method HTTP request Description
query_categories GET /apis/api.content.halo.run/v1alpha1/categories
query_category_by_name GET /apis/api.content.halo.run/v1alpha1/categories/{name}
query_posts_by_category_name GET /apis/api.content.halo.run/v1alpha1/categories/{name}/posts

query_categories

CategoryVoList query_categories(page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort)

Lists categories.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.category_vo_list import CategoryVoList
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.CategoryV1alpha1PublicApi(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)

    try:
        api_response = api_instance.query_categories(page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort)
        print("The response of CategoryV1alpha1PublicApi->query_categories:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoryV1alpha1PublicApi->query_categories: %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.

Return type

CategoryVoList

Authorization

basicAuth, bearerAuth

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]

query_category_by_name

CategoryVo query_category_by_name(name)

Gets category by name.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.category_vo import CategoryVo
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.CategoryV1alpha1PublicApi(api_client)
    name = 'name_example' # str | Category name

    try:
        api_response = api_instance.query_category_by_name(name)
        print("The response of CategoryV1alpha1PublicApi->query_category_by_name:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoryV1alpha1PublicApi->query_category_by_name: %s\n" % e)

Parameters

Name Type Description Notes
name str Category name

Return type

CategoryVo

Authorization

basicAuth, bearerAuth

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]

query_posts_by_category_name

ListedPostVoList query_posts_by_category_name(name, page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort)

Lists posts by category name.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.listed_post_vo_list import ListedPostVoList
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.CategoryV1alpha1PublicApi(api_client)
    name = 'name_example' # str | Category name
    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)

    try:
        api_response = api_instance.query_posts_by_category_name(name, page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort)
        print("The response of CategoryV1alpha1PublicApi->query_posts_by_category_name:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CategoryV1alpha1PublicApi->query_posts_by_category_name: %s\n" % e)

Parameters

Name Type Description Notes
name str Category name
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.

Return type

ListedPostVoList

Authorization

basicAuth, bearerAuth

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]