Skip to content

Commit

Permalink
Merge pull request #3 from Tencent/master
Browse files Browse the repository at this point in the history
merge from tencent
  • Loading branch information
jerry-tom committed Jun 7, 2018
2 parents 5241b37 + e77e450 commit 7c9f3e0
Show file tree
Hide file tree
Showing 242 changed files with 12,385 additions and 2,227 deletions.
53 changes: 53 additions & 0 deletions docs/apidoc/proc_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"condition":{
"bk_biz_id":"12233",
"bk_process_name":"nginx"
"bk_module_name":"nginx"
}
}
Expand Down Expand Up @@ -275,6 +276,58 @@ body 字段为进程属性
| bk_error_msg | string | 请求失败返回的错误信息 |error message from failed request|
| data | string | 请求返回的数据 |the data response|



### 批量更新进程
* API: PUT /api/{version}/proc/{bk_supplier_account}/{bk_biz_id}
* API名称: batch_update_process
* 功能说明:
* 中文:批量更新进程
* English :update process
* input body:
```
{
"bk_process_id" : "44,45,46,47,48",
"start_cmd": "./start.sh 8080",
"port": "1000"
...
// "bk_process_name": "assdfasdfasf", // 不允许批量编辑
// "bk_func_id" : "111", // 不允许批量编辑
}
}
```

* input字段说明:

| 名称 | 类型 |必填| 默认值 | 说明 | Description|
| --- | --- | --- |--- | --- | ---|
| bk_supplier_account| string|||开发商 code |supplier account code|
| bk_biz_id| int |||业务 id|business id |
| bk_process_id| string|||逗号分隔的进程id列表|process id|
body 字段为进程属性


* output:

```
{
"result":true,
"bk_error_code":0,
"bk_error_msg":"",
"data":"success"
}
```

* output字段说明:

| 名称 | 类型 | 说明 |Description|
|---|---|---|---|
| result | bool | 请求成功与否。true:请求成功;false请求失败 |request result true or false|
| bk_error_code | int | 错误编码。 0表示success,>0表示失败错误 |error code. 0 represent success, >0 represent failure code |
| bk_error_msg | string | 请求失败返回的错误信息 |error message from failed request|
| data | string | 请求返回的数据 |the data response|


### 获取进程绑定模块
* API: GET /api/{version}/proc/module/{bk_supplier_account}/{bk_biz_id}/{bk_process_id}
* API名称: get_process_bind_module
Expand Down
116 changes: 116 additions & 0 deletions docs/overview/framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -874,3 +874,119 @@ GetChildren() ([]Topo, error)
>> - model.Classification:模型分类对象,通过此对象可以对该分类下的模型进行管理。
>> - error: 如果创建实例失败会返回错误。

### 事件订阅 API

#### 事件回调方法声明

```` golang
// EventCallbackFunc the event deal function
type EventCallbackFunc func(evn []*Event) error
````

#### 取消事件订阅

> 方法:UnRegisterEvent(eventKey types.EventKey)
>
> 参数:
>
>> - eventKey:注册事件后返回的Key
>>
> 返回值:
>
>>
#### 订阅主机信息变更事件

> 方法:RegisterEventHost(eventFunc types.EventCallbackFunc) types.EventKey
>
> 参数:
>
>> - eventFunc:事件回调方法
>>
> 返回值:
>
>> - 注册事件关联的Key

#### 订阅业务信息变更事件

> 方法:RegisterEventBusiness(eventFunc types.EventCallbackFunc) types.EventKey
>
> 参数:
>
>> - eventFunc:事件回调方法
>>
> 返回值:
>
>> - 注册事件关联的Key
#### 订阅模块信息变更事件

> 方法:RegisterEventModule(eventFunc types.EventCallbackFunc) types.EventKey
>
> 参数:
>
>> - eventFunc:事件回调方法
>>
> 返回值:
>
>> - 注册事件关联的Key

#### 订阅主机身份信息变更事件

> 方法:RegisterEventHostIdentifier(eventFunc types.EventCallbackFunc) types.EventKey
>
> 参数:
>
>> - eventFunc:事件回调方法
>>
> 返回值:
>
>> - 注册事件关联的Key

#### 订阅集群信息变更事件

> 方法:RegisterEventSet(eventFunc types.EventCallbackFunc) types.EventKey
>
> 参数:
>
>> - eventFunc:事件回调方法
>>
> 返回值:
>
>> - 注册事件关联的Key
#### 订阅通用模型实例信息变更事件

> 方法:RegisterEventInst(eventFunc types.EventCallbackFunc) types.EventKey
>
> 参数:
>
>> - eventFunc:事件回调方法
>>
> 返回值:
>
>> - 注册事件关联的Key
#### 订阅模块转移信息变更事件

> 方法:RegisterEventModuleTransfer(eventFunc types.EventCallbackFunc) types.EventKey
>
> 参数:
>
>> - eventFunc:事件回调方法
>>
> 返回值:
>
>> - 注册事件关联的Key
1 change: 1 addition & 0 deletions resources/language/default/property.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"host_property_bk_state_name": "所在国家",
"host_property_bk_province_name": "所在省份",
"host_property_bk_isp_name": "所属运营商",
"process_property_bk_biz_id": "业务ID",
"process_property_bk_process_name": "进程名称",
"process_property_description": "进程描述",
"process_property_bind_ip": "绑定IP",
Expand Down
1 change: 1 addition & 0 deletions resources/language/en/property.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"host_property_bk_province_name": "province name",
"host_property_bk_isp_name": "isp name",

"process_property_bk_biz_id": "business id",
"process_property_bk_process_name": "process name",
"process_property_description": "description",
"process_property_bind_ip": "bind ip",
Expand Down
21 changes: 21 additions & 0 deletions src/api_server/ccapi/actions/v2/apifactory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/

package v2

import (
_ "configcenter/src/api_server/ccapi/actions/v2/phpapi/application" // import audit log(operationlog)
_ "configcenter/src/api_server/ccapi/actions/v2/phpapi/host" // import host
_ "configcenter/src/api_server/ccapi/actions/v2/phpapi/plat" // import event
_ "configcenter/src/api_server/ccapi/actions/v2/phpapi/process" // import topo
_ "configcenter/src/api_server/ccapi/actions/v2/phpapi/property" // import process"
)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package v2

package phpapi

const APIVersion = "/v2"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
package application

import (
"configcenter/src/api_server/ccapi/actions/v2"
"encoding/json"
"fmt"
"strconv"
"strings"

"github.com/emicklei/go-restful"

v2 "configcenter/src/api_server/ccapi/actions/v2/phpapi"
logics "configcenter/src/api_server/ccapi/logics/v2"
"configcenter/src/api_server/ccapi/logics/v2/common/converter"
"configcenter/src/api_server/ccapi/logics/v2/common/defs"
Expand All @@ -24,11 +31,6 @@ import (
"configcenter/src/common/core/cc/actions"
httpcli "configcenter/src/common/http/httpclient"
"configcenter/src/common/util"
"encoding/json"
"fmt"
"github.com/emicklei/go-restful"
"strconv"
"strings"
)

var app *appAction = &appAction{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@
package application

import (
"configcenter/src/api_server/ccapi/actions/v2"
"encoding/json"
"fmt"
"strconv"
"strings"

"github.com/emicklei/go-restful"

v2 "configcenter/src/api_server/ccapi/actions/v2/phpapi"
"configcenter/src/api_server/ccapi/logics/v2/common/converter"
"configcenter/src/api_server/ccapi/logics/v2/common/utils"
"configcenter/src/common"
Expand All @@ -22,11 +29,6 @@ import (
"configcenter/src/common/core/cc/actions"
httpcli "configcenter/src/common/http/httpclient"
"configcenter/src/common/util"
"encoding/json"
"fmt"
"github.com/emicklei/go-restful"
"strconv"
"strings"
)

var module *moduleAction = &moduleAction{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
package application

import (
logics "configcenter/src/api_server/ccapi/logics/v2"
"configcenter/src/api_server/ccapi/logics/v2/common/converter"
"configcenter/src/api_server/ccapi/logics/v2/common/utils"
"configcenter/src/common"
"configcenter/src/common/base"
"configcenter/src/common/blog"
"configcenter/src/common/core/cc/actions"
httpcli "configcenter/src/common/http/httpclient"
"encoding/json"
"fmt"
"net/url"
Expand All @@ -29,7 +21,15 @@ import (

"github.com/emicklei/go-restful"

"configcenter/src/api_server/ccapi/actions/v2"
v2 "configcenter/src/api_server/ccapi/actions/v2/phpapi"
logics "configcenter/src/api_server/ccapi/logics/v2"
"configcenter/src/api_server/ccapi/logics/v2/common/converter"
"configcenter/src/api_server/ccapi/logics/v2/common/utils"
"configcenter/src/common"
"configcenter/src/common/base"
"configcenter/src/common/blog"
"configcenter/src/common/core/cc/actions"
httpcli "configcenter/src/common/http/httpclient"
"configcenter/src/common/util"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@
package host

import (
"configcenter/src/api_server/ccapi/actions/v2"
"encoding/json"
"fmt"
"strings"

"github.com/emicklei/go-restful"

v2 "configcenter/src/api_server/ccapi/actions/v2/phpapi"
"configcenter/src/api_server/ccapi/logics/v2/common/converter"
"configcenter/src/common"
"configcenter/src/common/blog"
"configcenter/src/common/core/cc/actions"
httpcli "configcenter/src/common/http/httpclient"
"configcenter/src/common/util"
"encoding/json"
"fmt"
"github.com/emicklei/go-restful"
"strings"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
package host

import (
"encoding/json"
"fmt"
"strconv"

"configcenter/src/common/util"
"github.com/emicklei/go-restful"

v2 "configcenter/src/api_server/ccapi/actions/v2/phpapi"
"configcenter/src/api_server/ccapi/logics/v2/common/converter"
"configcenter/src/api_server/ccapi/logics/v2/common/utils"
"configcenter/src/common"
"configcenter/src/common/base"
"configcenter/src/common/blog"
"configcenter/src/common/core/cc/actions"
httpcli "configcenter/src/common/http/httpclient"
"encoding/json"
"fmt"
"strconv"

"configcenter/src/api_server/ccapi/actions/v2"

"configcenter/src/common/util"
"github.com/emicklei/go-restful"
)

var gse *gseAction = &gseAction{}
Expand Down

0 comments on commit 7c9f3e0

Please sign in to comment.