This PHP package is automatically generated by the Swagger Codegen project:
- API version: v0.0.2
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
$key = "key_example"; // string | 字段名
$operator = "operator_example"; // string | 删除配置的操作者,域账号
try {
$apiInstance->deleteField($app_id, $env, $cluster_name, $namespace_name, $key, $operator);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deleteField: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->getAppInfo();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getAppInfo: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
try {
$result = $apiInstance->getClusters($app_id, $env, $cluster_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getClusters: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
try {
$result = $apiInstance->getEnvClustersById($app_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getEnvClustersById: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
$key = "key_example"; // string | 字段名
try {
$result = $apiInstance->getField($app_id, $env, $cluster_name, $namespace_name, $key);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getField: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
try {
$result = $apiInstance->getLock($app_id, $env, $cluster_name, $namespace_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getLock: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
try {
$result = $apiInstance->getNamespace($app_id, $env, $cluster_name, $namespace_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getNamespace: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
try {
$result = $apiInstance->getNamespaces($app_id, $env, $cluster_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getNamespaces: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
try {
$result = $apiInstance->getReleases($app_id, $env, $cluster_name, $namespace_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->getReleases: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \Swagger\Client\Model\ClusterInfoBase(); // \Swagger\Client\Model\ClusterInfoBase | post携带参数
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
try {
$result = $apiInstance->postClusters($body, $app_id, $env);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->postClusters: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \Swagger\Client\Model\FieldBase(); // \Swagger\Client\Model\FieldBase | post携带参数
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
try {
$result = $apiInstance->postField($body, $app_id, $env, $cluster_name, $namespace_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->postField: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \Swagger\Client\Model\NamespaceBase(); // \Swagger\Client\Model\NamespaceBase | post携带参数
$app_id = "app_id_example"; // string | 应用id
try {
$result = $apiInstance->postNamespace($body, $app_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->postNamespace: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \Swagger\Client\Model\ReleasesPost(); // \Swagger\Client\Model\ReleasesPost | post携带参数
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
try {
$result = $apiInstance->postReleases($body, $app_id, $env, $cluster_name, $namespace_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->postReleases: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \Swagger\Client\Model\FieldPut(); // \Swagger\Client\Model\FieldPut | 携带参数
$app_id = "app_id_example"; // string | 应用id
$env = "env_example"; // string | 环境
$cluster_name = "cluster_name_example"; // string | 集群名称
$namespace_name = "namespace_name_example"; // string | 命名空间名称
$key = "key_example"; // string | 字段名
$create_if_not_exists = true; // bool | 当配置不存在时是否自动创建
try {
$apiInstance->putField($body, $app_id, $env, $cluster_name, $namespace_name, $key, $create_if_not_exists);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->putField: ', $e->getMessage(), PHP_EOL;
}
// Configure API key authorization: ApiKeyAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new Swagger\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$operator = "operator_example"; // string | 删除配置的操作者,域账号
$release_id = "release_id_example"; // string | 发布记录id
$env = "env_example"; // string | 环境
try {
$result = $apiInstance->rollback($operator, $release_id, $env);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->rollback: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to http://config-admin.test.huajiao.com/openapi/v1
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | deleteField | DELETE /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key} | 删除配置接口 |
DefaultApi | getAppInfo | GET /apps | 获取App信息 |
DefaultApi | getClusters | GET /envs/{env}/apps/{appId}/clusters/{clusterName} | 获取集群接口 |
DefaultApi | getEnvClustersById | GET /apps/{appId}/envclusters | 获取App的环境,集群信息 |
DefaultApi | getField | GET /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key} | 读取配置接口 |
DefaultApi | getLock | GET /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/lock | 获取某个Namespace当前编辑人接口 |
DefaultApi | getNamespace | GET /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName} | 获取某个Namespace信息接口 |
DefaultApi | getNamespaces | GET /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces | 获取集群下所有Namespace信息接口 |
DefaultApi | getReleases | GET /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest | 获取生效配置接口 |
DefaultApi | postClusters | POST /envs/{env}/apps/{appId}/clusters | 创建集群接口 |
DefaultApi | postField | POST /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items | 新增配置接口 |
DefaultApi | postNamespace | POST /apps/{appId}/appnamespaces | 创建Namespace |
DefaultApi | postReleases | POST /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases | 发布配置接口 |
DefaultApi | putField | PUT /envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items/{key} | 修改配置接口 |
DefaultApi | rollback | PUT /envs/{env}/releases/{releaseId}/rollback | 回滚已发布配置接口 |
- AppInfo
- ClusterInfo
- ClusterInfoBase
- EnvCluster
- Field
- FieldBase
- FieldPut
- Lock
- ModelNamespace
- NamespaceBase
- NamespaceInfo
- Releases
- ReleasesConfigurations
- ReleasesPost
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header