ops-itop / cmdbapi Goto Github PK
View Code? Open in Web Editor NEWitop cmdb API
itop cmdb API
计划使用zabbix
cmdb中用集群来规划机器,对用户赋予集群权限,或者机器权限
(lnkPersonToServer, lnkPersonToCluster)
api提供接口供机器调用,用来增删账号
use strategic-merge-patch+json
can not patch service when change service ports
# kubectl --v=7 -n dev patch service app1 --patch '{"spec":{"ports":[{"port":805,"targetPort":805}]}}'
I1119 18:30:55.204013 7361 loader.go:357] Config loaded from file /root/.kube/config
I1119 18:30:55.216967 7361 round_trippers.go:414] GET https://10.112.35.104/api/v1/namespaces/dev/services/app1
I1119 18:30:55.216990 7361 round_trippers.go:421] Request Headers:
I1119 18:30:55.217001 7361 round_trippers.go:424] Accept: application/json
I1119 18:30:55.217010 7361 round_trippers.go:424] User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
I1119 18:30:55.243264 7361 round_trippers.go:439] Response Status: 200 OK in 26 milliseconds
I1119 18:30:55.244290 7361 round_trippers.go:414] PATCH https://10.112.35.104/api/v1/namespaces/dev/services/app1
I1119 18:30:55.244311 7361 round_trippers.go:421] Request Headers:
I1119 18:30:55.244322 7361 round_trippers.go:424] Accept: application/json
I1119 18:30:55.244333 7361 round_trippers.go:424] Content-Type: application/strategic-merge-patch+json
I1119 18:30:55.244344 7361 round_trippers.go:424] User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
I1119 18:30:55.247526 7361 round_trippers.go:439] Response Status: 422 Unprocessable Entity in 3 milliseconds
F1119 18:30:55.247793 7361 helpers.go:119] The Service "app1" is invalid:
* spec.ports[0].name: Required value
* spec.ports[1].name: Required value
use --type merge
, Content-Type
is Content-Type: application/merge-patch+json
, can patch successful.
# kubectl --v=7 -n dev patch service app1 --patch '{"spec":{"ports":[{"port":804,"targetPort":804}]}}' --type merge
I1119 18:28:17.370216 6169 loader.go:357] Config loaded from file /root/.kube/config
I1119 18:28:17.388940 6169 round_trippers.go:414] GET https://10.112.35.104/api/v1/namespaces/dev/services/app1
I1119 18:28:17.388971 6169 round_trippers.go:421] Request Headers:
I1119 18:28:17.388983 6169 round_trippers.go:424] Accept: application/json
I1119 18:28:17.388994 6169 round_trippers.go:424] User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
I1119 18:28:17.415048 6169 round_trippers.go:439] Response Status: 200 OK in 26 milliseconds
I1119 18:28:17.416141 6169 round_trippers.go:414] PATCH https://10.112.35.104/api/v1/namespaces/dev/services/app1
I1119 18:28:17.416164 6169 round_trippers.go:421] Request Headers:
I1119 18:28:17.416175 6169 round_trippers.go:424] Accept: application/json
I1119 18:28:17.416186 6169 round_trippers.go:424] Content-Type: application/merge-patch+json
I1119 18:28:17.416226 6169 round_trippers.go:424] User-Agent: kubectl/v1.9.5 (linux/amd64) kubernetes/f01a2bf
I1119 18:28:17.422360 6169 round_trippers.go:439] Response Status: 200 OK in 6 milliseconds
service "app1" patched
so can we make this header configurable?
filter用于输出objects过滤,例如
array("Person","Server"),限制只输出Person和Server类型的对象
服务器增加监控状态属性,由audit_server.php更新该服务器的监控状态
10:10:31 504
10:11:13 503
10:15:38 404
用了5分钟才迁移(可能是受 kube-controller-manager --pod-eviction-timeout 参数影响: duration The grace period for deleting pods on failed nodes. (default 5m0s)
)
考虑配置livenessProbe来加快迁移
web接口全部加缓存。使用action-shell-exec更新缓存
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.