Skip to content

[Feature Request]: HTTP API: Supports GET/SET variables. #1180

@JinHai-CN

Description

@JinHai-CN

Is there an existing issue for the same feature request?

  • I have checked the existing issues.

Is your feature request related to a problem?

No response

Describe the feature you'd like

The Infinity HTTP API already provides the show command to display the status of the infinity internal database. However, there is no way to access the configuration and variables within the system. The goal of this PR is to propose a couple of HTTP APIs to accomplish this.

  • Show variables
curl --request GET \
     --url localhost:23820/variables/ \
     --header 'accept: application/json'
  • Show configs
curl --request GET \
     --url localhost:23820/configs/ \
     --header 'accept: application/json'
  • Show variable
curl --request GET \
     --url localhost:23820/variables/{variable_name} \
     --header 'accept: application/json'
  • Show config
curl --request GET \
     --url localhost:23820/configs/{config_name} \
     --header 'accept: application/json'
  • Set variable
curl --request POST \
     --url localhost:23820/variables \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data ' \
{
    "{variable_name}": "{new_value}"
} '

Describe implementation you've considered

No response

Documentation, adoption, use case

No response

Additional information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions