mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 16:13:56 +08:00
Compare commits
260 Commits
release/3.
...
v3.1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fc93016dd | ||
|
|
3b29ecb087 | ||
|
|
4a04405b5d | ||
|
|
ff27373bb2 | ||
|
|
9bad7f3485 | ||
|
|
0eb4468c79 | ||
|
|
d8b614bbdf | ||
|
|
776438f682 | ||
|
|
321e54def0 | ||
|
|
0f0bb35170 | ||
|
|
7b0ceddd6b | ||
|
|
e2fafe2b46 | ||
|
|
f396592d2e | ||
|
|
18fca8d90b | ||
|
|
7c85b20733 | ||
|
|
48c0c536fc | ||
|
|
188662cd51 | ||
|
|
dd01e8cf49 | ||
|
|
ca7f5495fe | ||
|
|
34b7d1e9c3 | ||
|
|
13a3e1c778 | ||
|
|
603b3f8b8e | ||
|
|
2c1e0a4fe2 | ||
|
|
f9a9f92003 | ||
|
|
8d1c0ba9c9 | ||
|
|
845ba285fc | ||
|
|
72f1e58833 | ||
|
|
1cc1ff7213 | ||
|
|
6c15c80abb | ||
|
|
7869e3d134 | ||
|
|
2e0efc6c4a | ||
|
|
1d440b57ce | ||
|
|
e3c564bd56 | ||
|
|
45e04c4d50 | ||
|
|
ee0f6de3b0 | ||
|
|
608be69260 | ||
|
|
88fa459aac | ||
|
|
b4bb5d902f | ||
|
|
7f467ab3a7 | ||
|
|
5c1714d11d | ||
|
|
5f36cbb31c | ||
|
|
850544ee4d | ||
|
|
7ff8935abc | ||
|
|
874cf21b00 | ||
|
|
231fefed1f | ||
|
|
5dd591f1bb | ||
|
|
ab32057ab1 | ||
|
|
84fec885e8 | ||
|
|
8057b95ac2 | ||
|
|
9adac58590 | ||
|
|
f409fca66b | ||
|
|
edd7136d3e | ||
|
|
b1c80010cc | ||
|
|
5ff255d622 | ||
|
|
fb531b4d68 | ||
|
|
03cd5dc63a | ||
|
|
fa48381bd7 | ||
|
|
38a6decc25 | ||
|
|
627495d200 | ||
|
|
37b823a43c | ||
|
|
112eb0d7ae | ||
|
|
bee314a0e6 | ||
|
|
60ef016f42 | ||
|
|
da235de896 | ||
|
|
68a425ebd5 | ||
|
|
15f6b94bec | ||
|
|
d8dd372cb0 | ||
|
|
e14a596d9f | ||
|
|
a0ab40dbb8 | ||
|
|
75e49ac8c6 | ||
|
|
590ec32860 | ||
|
|
57fd313b43 | ||
|
|
86e4df54d9 | ||
|
|
a9f60a7b1a | ||
|
|
087de62171 | ||
|
|
8577cb096e | ||
|
|
2110057bac | ||
|
|
3c09ce17d0 | ||
|
|
dc870afaed | ||
|
|
fcb8bba00c | ||
|
|
7996a02a80 | ||
|
|
3349dc46c5 | ||
|
|
a85fd307d3 | ||
|
|
37f1906f72 | ||
|
|
d5096ad4ee | ||
|
|
24da237790 | ||
|
|
d34b00ddc4 | ||
|
|
2f47d93215 | ||
|
|
1bbf79528b | ||
|
|
0c0c4fc94d | ||
|
|
01de80ed09 | ||
|
|
3861bb6bc1 | ||
|
|
681fee1317 | ||
|
|
2496a12833 | ||
|
|
c76062406d | ||
|
|
df94352e00 | ||
|
|
5b9c7ba9f2 | ||
|
|
e8dc05084a | ||
|
|
0774a2ded0 | ||
|
|
50421b06b9 | ||
|
|
7e7825a681 | ||
|
|
45b8a7afd9 | ||
|
|
4ec1fc58d9 | ||
|
|
69564365b9 | ||
|
|
54caca2d04 | ||
|
|
ce3241d046 | ||
|
|
40773180fa | ||
|
|
32411bf2ec | ||
|
|
c99265e743 | ||
|
|
2d4cff4ef1 | ||
|
|
bb90b5e8a1 | ||
|
|
b1c4bc276f | ||
|
|
1923e36740 | ||
|
|
7bec5e6f7e | ||
|
|
b40be2608b | ||
|
|
46d2f6efb7 | ||
|
|
d55f1db7ff | ||
|
|
0bcc19d7c1 | ||
|
|
b395dc8cee | ||
|
|
c908e0c19a | ||
|
|
ce5a95607f | ||
|
|
d4ba5ca52e | ||
|
|
92129824c0 | ||
|
|
7326b1fb0d | ||
|
|
1b5756fe1c | ||
|
|
08f8ce1f7c | ||
|
|
2c5234b97e | ||
|
|
37049bd5f3 | ||
|
|
177ba6cf2c | ||
|
|
bf2bb9878f | ||
|
|
530b2a1422 | ||
|
|
1eba8b8a7e | ||
|
|
4829e0d285 | ||
|
|
b29d6d4f4e | ||
|
|
d41c3bfea7 | ||
|
|
907058464a | ||
|
|
c727334bc4 | ||
|
|
b7e2c462cb | ||
|
|
1efc0fe07b | ||
|
|
9d1b407c40 | ||
|
|
67c2435f4f | ||
|
|
c11c79ef71 | ||
|
|
c245013e59 | ||
|
|
83b4916646 | ||
|
|
f6d1ea7b25 | ||
|
|
c988fd1b1f | ||
|
|
f6df6d34e0 | ||
|
|
44183902f7 | ||
|
|
64fda24e76 | ||
|
|
0701512da9 | ||
|
|
71499e7e1b | ||
|
|
6f6cf7cd64 | ||
|
|
8f175ec326 | ||
|
|
c0c26c7c40 | ||
|
|
42cd5b1435 | ||
|
|
4fafb8ae75 | ||
|
|
8349dcbba3 | ||
|
|
85a792d2b1 | ||
|
|
71fee70283 | ||
|
|
456c5fb50e | ||
|
|
b706356ba9 | ||
|
|
ed2bba3dd5 | ||
|
|
b6e701a6b2 | ||
|
|
c21636b521 | ||
|
|
2e0f424c73 | ||
|
|
a2f30806cf | ||
|
|
0c0b4b43aa | ||
|
|
209bee4181 | ||
|
|
ba265a7b83 | ||
|
|
1a8f8dcb93 | ||
|
|
2a01c86428 | ||
|
|
dc75d93414 | ||
|
|
fe44564bf7 | ||
|
|
8cd23304ae | ||
|
|
4b8e13f171 | ||
|
|
b6739ba7e8 | ||
|
|
3db7b0c962 | ||
|
|
0d6480723d | ||
|
|
9a91bf244c | ||
|
|
b1a641ca4d | ||
|
|
c65e1e0855 | ||
|
|
d8fc57b217 | ||
|
|
f9a47d94c7 | ||
|
|
ac2c3697bf | ||
|
|
b1048baef3 | ||
|
|
bfc1f0125f | ||
|
|
4b6d0107b0 | ||
|
|
1948c12012 | ||
|
|
6345086c5b | ||
|
|
08d412669d | ||
|
|
c85a8d354e | ||
|
|
03be58f39a | ||
|
|
60cb619043 | ||
|
|
91c39cf8cd | ||
|
|
f73ac4844f | ||
|
|
e681f66aad | ||
|
|
d7bf41e173 | ||
|
|
ea3247eaba | ||
|
|
d91dbf5f47 | ||
|
|
52129c544b | ||
|
|
a3b3e9c627 | ||
|
|
04c73b189d | ||
|
|
f75dbefbfd | ||
|
|
a2e4490613 | ||
|
|
2c32832946 | ||
|
|
18239e30cc | ||
|
|
77d6e24ae7 | ||
|
|
d5f6473d57 | ||
|
|
f7d927cbdd | ||
|
|
56a3d9c05d | ||
|
|
a4b76036c5 | ||
|
|
9e20cce793 | ||
|
|
f7b3b0c1a0 | ||
|
|
6404e3c2a0 | ||
|
|
9a1b040933 | ||
|
|
b5468ca840 | ||
|
|
77bbb2bda8 | ||
|
|
562498da68 | ||
|
|
b91c19bcb5 | ||
|
|
e48c4d0bb2 | ||
|
|
8c3872000a | ||
|
|
7fde85b83f | ||
|
|
262096d99d | ||
|
|
60ba83b40f | ||
|
|
5834ec297e | ||
|
|
8701c6172e | ||
|
|
d912e29772 | ||
|
|
bf0adeb0e2 | ||
|
|
8857a6281e | ||
|
|
5537648dc7 | ||
|
|
158750373b | ||
|
|
8a719ffe1f | ||
|
|
c1278bf088 | ||
|
|
86d6a224cd | ||
|
|
6b6a15e6b8 | ||
|
|
4a2b10e842 | ||
|
|
38557f8bcd | ||
|
|
8739393e52 | ||
|
|
fdad1303bc | ||
|
|
bd2d11f964 | ||
|
|
01c962f1c6 | ||
|
|
d5ec862e26 | ||
|
|
1e04ddfe5e | ||
|
|
67a6f9687d | ||
|
|
9bfb6c0c8e | ||
|
|
b4fff49236 | ||
|
|
8536166426 | ||
|
|
4bd9051ae4 | ||
|
|
74c272cfae | ||
|
|
38aed0ca4a | ||
|
|
06eea75674 | ||
|
|
ad73aa590a | ||
|
|
4322981be4 | ||
|
|
655d3632fa | ||
|
|
cd34e0db95 | ||
|
|
aae5d0dc33 | ||
|
|
51b2f4d3af | ||
|
|
f7987dbf61 | ||
|
|
f1282345f1 | ||
|
|
9046117e00 |
@@ -1,38 +0,0 @@
|
||||
FROM centos:7
|
||||
MAINTAINER Yousong Zhou <zhouyousong@yunion.cn>
|
||||
|
||||
RUN true \
|
||||
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
|
||||
&& yum install -y git wget \
|
||||
&& yum groupinstall -y "Development Tools" \
|
||||
&& : ceph for cmd/host \
|
||||
&& rpm --import 'https://download.ceph.com/keys/release.asc' \
|
||||
&& yum install -y https://download.ceph.com/rpm-luminous/el7/noarch/ceph-release-1-1.el7.noarch.rpm \
|
||||
&& yum install -y libcephfs-devel librbd-devel librados-devel \
|
||||
&& yum clean all
|
||||
|
||||
WORKDIR /opt
|
||||
RUN true \
|
||||
&& wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz \
|
||||
&& tar xzf go1.13.3.linux-amd64.tar.gz \
|
||||
&& rm -vf go1.13.3.linux-amd64.tar.gz \
|
||||
&& true
|
||||
ENV GOROOT="/opt/go"
|
||||
ENV PATH="/opt/go/bin:${PATH}"
|
||||
|
||||
RUN useradd -c "OneCloud Builder" --create-home --home-dir /home/build --shell /bin/bash build
|
||||
ENV HOME /home/build
|
||||
WORKDIR /home/build
|
||||
USER build
|
||||
|
||||
ENV GOPATH="/home/build/go"
|
||||
ENV PATH="${GOPATH}/bin:${PATH}"
|
||||
|
||||
RUN true \
|
||||
&& mkdir -p "$GOPATH" \
|
||||
&& d="$GOPATH/src/golang.org/x/tools" \
|
||||
&& mkdir -p "$d" \
|
||||
&& git clone --branch yun --depth 8 https://github.com/yousong/tools "$d" \
|
||||
&& cd "$d" \
|
||||
&& go install ./cmd/goimports \
|
||||
&& true
|
||||
@@ -5,10 +5,10 @@ version: 2
|
||||
jobs:
|
||||
check:
|
||||
docker:
|
||||
- image: yunionio/onecloud-ci:v1.0.3
|
||||
- image: yunionio/centos-build:1.0-1
|
||||
environment:
|
||||
ONECLOUD_CI_BUILD: "1"
|
||||
working_directory: /home/build/go/src/yunion.io/x/onecloud
|
||||
working_directory: /root/go/onecloud
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
requires:
|
||||
- check
|
||||
docker:
|
||||
- image: yunionio/onecloud-ci:v1.0.2
|
||||
- image: yunionio/centos-build:1.0-1
|
||||
environment:
|
||||
ONECLOUD_CI_BUILD: "1"
|
||||
|
||||
@@ -26,14 +26,14 @@ jobs:
|
||||
#### expecting it in the form of
|
||||
#### /go/src/github.com/circleci/go-tool
|
||||
#### /go/src/bitbucket.org/circleci/go-tool
|
||||
working_directory: /home/build/go/src/yunion.io/x/onecloud
|
||||
working_directory: /root/go/onecloud
|
||||
parallelism: 4
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
|
||||
paths:
|
||||
- /home/build/.cache/go-build
|
||||
- /root/.cache/go-build
|
||||
- run:
|
||||
command: |
|
||||
targets="$(circleci tests glob "cmd/*" | grep -v cmd/host-image | circleci tests split)"
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
- save_cache:
|
||||
key: onecloud-build-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
|
||||
paths:
|
||||
- /home/build/.cache/go-build
|
||||
- /root/.cache/go-build
|
||||
- store_artifacts:
|
||||
path: _output/
|
||||
|
||||
@@ -51,16 +51,16 @@ jobs:
|
||||
requires:
|
||||
- check
|
||||
docker:
|
||||
- image: yunionio/onecloud-ci:v1.0.2
|
||||
- image: yunionio/centos-build:1.0-1
|
||||
environment:
|
||||
GO111MODULE: "on"
|
||||
working_directory: /home/build/go/src/yunion.io/x/onecloud
|
||||
working_directory: /root/go/onecloud
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
|
||||
paths:
|
||||
- /home/build/.cache/go-build
|
||||
- /root/.cache/go-build
|
||||
- run:
|
||||
name: unit_test
|
||||
command: |
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
- save_cache:
|
||||
key: onecloud-test-cache-{{ checksum "go.mod" }}-{{ checksum "Makefile" }}
|
||||
paths:
|
||||
- /home/build/.cache/go-build
|
||||
- /root/.cache/go-build
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
14
.github/workflows/docker.yml
vendored
14
.github/workflows/docker.yml
vendored
@@ -29,17 +29,17 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install librados-dev librbd-dev
|
||||
sudo apt-get install librados-dev librbd-dev # baremetal-agent needs this
|
||||
make cmd/apigateway cmd/climc cmd/keystone
|
||||
make cmd/logger cmd/region cmd/scheduler cmd/webconsole
|
||||
make cmd/yunionconf cmd/glance cmd/torrent cmd/s3gateway
|
||||
make cmd/ansibleserver cmd/cloudnet cmd/notify
|
||||
make cmd/host && ./scripts/bundle_libraries.sh _output/bin/bundles/host _output/bin/host && ./scripts/host_find_libraries.sh _output/bin/bundles/host
|
||||
make cmd/host-deployer && ./scripts/bundle_libraries.sh _output/bin/bundles/host-deployer _output/bin/host-deployer
|
||||
make cmd/baremetal-agent && ./scripts/bundle_libraries.sh _output/bin/bundles/baremetal-agent _output/bin/baremetal-agent
|
||||
make cmd/cloudevent cmd/devtool
|
||||
make cmd/*cli
|
||||
make cmd/esxi-agent
|
||||
make docker-alpine-build F='-j4 cmd/host cmd/vpcagent'
|
||||
|
||||
- name: Image baremetal-agent
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
@@ -61,6 +61,16 @@ jobs:
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.esxi-agent
|
||||
|
||||
- name: Image vpcagent
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: registry.cn-beijing.aliyuncs.com/yunionio/vpcagent
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
registry: registry.cn-beijing.aliyuncs.com
|
||||
snapshot: true
|
||||
dockerfile: build/docker/Dockerfile.vpcagent
|
||||
|
||||
- name: Image climc
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
|
||||
64
Makefile
64
Makefile
@@ -192,43 +192,75 @@ mod:
|
||||
go mod vendor -v
|
||||
|
||||
|
||||
DOCKER_BUILD_IMAGE_VERSION?=latest
|
||||
DOCKER_BUILD_IMAGE_VERSION?=1.0-1
|
||||
|
||||
define dockerBuildCmd
|
||||
define dockerCentOSBuildCmd
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
cd /home/build/onecloud
|
||||
cd /root/onecloud
|
||||
export GOFLAGS=-mod=vendor
|
||||
make $(1)
|
||||
chown -R $(shell id -u):$(shell id -g) _output
|
||||
endef
|
||||
|
||||
docker-build: export dockerBuildCmd:=$(call dockerBuildCmd,$(F))
|
||||
docker-build:
|
||||
echo "$$dockerBuildCmd"
|
||||
docker-centos-build: export dockerCentOSBuildCmd:=$(call dockerCentOSBuildCmd,$(F))
|
||||
docker-centos-build:
|
||||
docker rm --force onecloud-ci-build &>/dev/null || true
|
||||
docker run \
|
||||
--name onecloud-ci-build \
|
||||
--rm \
|
||||
--volume $(CURDIR):/home/build/onecloud \
|
||||
yunionio/onecloud-ci:$(DOCKER_BUILD_IMAGE_VERSION) \
|
||||
/bin/bash -c "$$dockerBuildCmd"
|
||||
--volume $(CURDIR):/root/onecloud \
|
||||
registry.cn-beijing.aliyuncs.com/yunionio/centos-build:$(DOCKER_BUILD_IMAGE_VERSION) \
|
||||
/bin/bash -c "$$dockerCentOSBuildCmd"
|
||||
chown -R $$(id -u):$$(id -g) _output
|
||||
ls -lh _output/bin
|
||||
|
||||
# NOTE we need a way to stop and remove the container started by docker-build.
|
||||
# No --tty, --stop-signal won't work
|
||||
docker-build-stop:
|
||||
docker stop --time 0 onecloud-ci-build || true
|
||||
docker-centos-build-stop:
|
||||
docker-centos stop --time 0 onecloud-ci-build || true
|
||||
|
||||
.PHONY: docker-build
|
||||
.PHONY: docker-build-stop
|
||||
.PHONY: docker-centos-build
|
||||
.PHONY: docker-centos-build-stop
|
||||
|
||||
define dockerAlpineBuildCmd
|
||||
set -o xtrace
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
cd /root/go/src/yunion.io/x/onecloud
|
||||
export GOFLAGS=-mod=vendor
|
||||
make $(1)
|
||||
chown -R $(shell id -u):$(shell id -g) _output
|
||||
endef
|
||||
|
||||
docker-alpine-build: export dockerAlpineBuildCmd:=$(call dockerAlpineBuildCmd,$(F))
|
||||
docker-alpine-build:
|
||||
docker rm --force onecloud-docker-alpine-build &>/dev/null || true
|
||||
docker run --rm \
|
||||
--name onecloud-docker-alpine-build \
|
||||
-v $(CURDIR):/root/go/src/yunion.io/x/onecloud \
|
||||
-v $(CURDIR)/_output/alpine-build:/root/go/src/yunion.io/x/onecloud/_output \
|
||||
registry.cn-beijing.aliyuncs.com/yunionio/alpine-build:1.0-1 \
|
||||
/bin/sh -c "$$dockerAlpineBuildCmd"
|
||||
ls -lh _output/alpine-build/bin
|
||||
|
||||
docker-alpine-build-stop:
|
||||
docker stop --time 0 onecloud-docker-alpine-build || true
|
||||
|
||||
.PHONY: docker-alpine-build
|
||||
.PHONY: docker-alpine-build-stop
|
||||
|
||||
define helpText
|
||||
Build with docker
|
||||
|
||||
make docker-build F='-j4'
|
||||
make docker-build F='-j4 cmd/region cmd/climc'
|
||||
make docker-build-stop
|
||||
make docker-centos-build F='-j4'
|
||||
make docker-centos-build F='-j4 cmd/region cmd/climc'
|
||||
make docker-centos-build-stop
|
||||
|
||||
make docker-alpine-build F='-j4'
|
||||
make docker-alpine-build F='-j4 cmd/host cmd/host-deployer'
|
||||
make docker-alpine-build-stop
|
||||
|
||||
Tidy up go modules and vendor directory
|
||||
|
||||
|
||||
42
build/climc/root/opt/yunion/scripts/tools/clean_account.sh
Executable file
42
build/climc/root/opt/yunion/scripts/tools/clean_account.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
pushd $(dirname $BASH_SOURCE) > /dev/null
|
||||
CUR_DIR=$(pwd -P)
|
||||
popd > /dev/null
|
||||
|
||||
|
||||
ACCOUNT=$1
|
||||
|
||||
if [ -z "$ACCOUNT" ]; then
|
||||
echo "Usage: $0 <cloud-acount-id-or-name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ACCOUNT_ID=$(climc cloud-account-show $ACCOUNT | grep -w " id " | awk '{print $4}')
|
||||
ACCOUNT_NAME=$(climc cloud-account-show $ACCOUNT | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$ACCOUNT_ID" ]; then
|
||||
echo "Cloud account $ACCOUNT not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
echo "Ready to clean cloud account $ACCOUNT_NAME($ACCOUNT_ID)..."
|
||||
|
||||
echo "1. Disable cloud account $ACCOUNT_NAME($ACCOUNT_ID) ..."
|
||||
|
||||
climc cloud-account-disable $ACCOUNT_ID
|
||||
|
||||
echo "2. Clean all providers ..."
|
||||
|
||||
for provider_id in $(climc cloud-provider-list --account $ACCOUNT_ID --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
echo "### to clean cloud provider $provider_id ..."
|
||||
$CUR_DIR/clean_provider.sh $provider_id
|
||||
done
|
||||
|
||||
echo "3. Delete cloud account ..."
|
||||
|
||||
climc cloud-account-delete $ACCOUNT_ID
|
||||
27
build/climc/root/opt/yunion/scripts/tools/clean_eip.sh
Executable file
27
build/climc/root/opt/yunion/scripts/tools/clean_eip.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
EIP=$1
|
||||
|
||||
if [ -z "$EIP" ]; then
|
||||
echo "Usage: $0 <eip_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
EIP_NAME=$(climc eip-show $EIP | grep -w " name " | awk '{print $4}')
|
||||
EIP_ID=$(climc eip-show $EIP | grep -w " id " | awk '{print $4}')
|
||||
|
||||
if [ -z "$EIP_ID" ]; then
|
||||
echo "Cannot find eip $EIP_ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "To clean eip $EIP_NAME($EIP_ID)..."
|
||||
|
||||
clean_eip() {
|
||||
local EID=$1
|
||||
climc eip-purge $EID
|
||||
}
|
||||
|
||||
clean_eip $EIP_ID
|
||||
80
build/climc/root/opt/yunion/scripts/tools/clean_host.sh
Executable file
80
build/climc/root/opt/yunion/scripts/tools/clean_host.sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
HOST=$1
|
||||
|
||||
if [ -z "$HOST" ]; then
|
||||
echo "Usage: $0 <host_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
error_exit() {
|
||||
echo "Error: $1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
HOSTID=$(climc host-show $HOST | grep -w " id " | awk '{print $4}')
|
||||
|
||||
HOSTNAME=$(climc host-show $HOST | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$HOSTNAME" ]; then
|
||||
error_exit "Cannot find host $HOST"
|
||||
fi
|
||||
|
||||
if [ -z "$HOSTID" ]; then
|
||||
error_exit "Cannot find host $HOST"
|
||||
fi
|
||||
|
||||
echo "Ready to purge host $HOSTNAME($HOSTID)..."
|
||||
|
||||
echo "1. Disable $HOSTNAME($HOSTID)"
|
||||
|
||||
if ! climc host-disable $HOSTID > /dev/null; then
|
||||
error_exit "Fail to disable $HOST"
|
||||
fi
|
||||
|
||||
echo "2. Clean servers on $HOSTNAME($HOSTID)"
|
||||
|
||||
for i in $(climc server-list --host $HOSTID --admin --limit 2048 --system | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc server-update --delete enable $i > /dev/null
|
||||
climc server-purge $i > /dev/null
|
||||
done
|
||||
|
||||
for i in $(climc server-list --host $HOSTID --admin --limit 2048 --pending-delete --system | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc server-purge $i > /dev/null
|
||||
done
|
||||
|
||||
echo "3. Clean disks on $HOSTNAME($HOSTID)"
|
||||
|
||||
for storageid in $(climc host-storage-list --host $HOSTID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $4}')
|
||||
do
|
||||
STORAGENAME=$(climc storage-show $storageid | grep -w " name " | awk '{print $4}')
|
||||
STORAGE_TYPE=$(climc storage-show $storageid | grep -w " storage_type " | awk '{print $4}')
|
||||
if [ "$STORAGE_TYPE" == "local" ]; then
|
||||
for diskid in $(climc disk-list --admin --system --details --search $storageid --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc disk-purge $diskid > /dev/null
|
||||
done
|
||||
for diskid in $(climc disk-list --admin --system --details --search $storageid --pending-delete --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc disk-purge $diskid > /dev/null
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
echo "4. Remove host $HOSTNAME($HOSTID)"
|
||||
|
||||
BAREMETAL=$(climc host-show $HOSTID | grep -w " is_baremetal " | awk '{print $4}')
|
||||
|
||||
HOSTTYPE=$(climc host-show $HOSTID | grep -w " host_type " | awk '{print $4}')
|
||||
|
||||
if [ "$BAREMETAL" == "true" ] && [ "$HOSTTYPE" != "baremetal" ]; then
|
||||
climc host-update --host-type baremetal $HOSTID > /dev/null
|
||||
fi
|
||||
|
||||
climc host-delete $HOSTID > /dev/null
|
||||
|
||||
echo "DONE."
|
||||
27
build/climc/root/opt/yunion/scripts/tools/clean_loadbalancer.sh
Executable file
27
build/climc/root/opt/yunion/scripts/tools/clean_loadbalancer.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
LB=$1
|
||||
|
||||
if [ -z "$LB" ]; then
|
||||
echo "Usage: $0 <loadbalancer_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LB_ID=$(climc lb-show $LB | grep -w " id " | awk '{print $4}')
|
||||
LB_NAME=$(climc lb-show $LB | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$LB_ID" ]; then
|
||||
echo "Loadbalancer $LB not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Ready to remove loadbalancer $LB_NAME($LB_ID) ..."
|
||||
|
||||
clean_loadbalancer() {
|
||||
local LID=$1
|
||||
climc lb-purge $LID
|
||||
}
|
||||
|
||||
clean_loadbalancer $LB_ID
|
||||
27
build/climc/root/opt/yunion/scripts/tools/clean_loadbalancer_acl.sh
Executable file
27
build/climc/root/opt/yunion/scripts/tools/clean_loadbalancer_acl.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
LB_ACL=$1
|
||||
|
||||
if [ -z "$LB_ACL" ]; then
|
||||
echo "Usage: $0 <loadbalancer_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LB_ACL_ID=$(climc lbacl-show $LB_ACL | grep -w " id " | awk '{print $4}')
|
||||
LB_ACL_NAME=$(climc lbacl-show $LB_ACL | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$LB_ACL_ID" ]; then
|
||||
echo "Loadbalancer ACL $LB_ACL_ID not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Ready to remove loadbalancer acl $LB_ACL_NAME($LB_ACL_ID) ..."
|
||||
|
||||
clean_loadbalancer_acl() {
|
||||
local LID=$1
|
||||
climc lbacl-purge $LID
|
||||
}
|
||||
|
||||
clean_loadbalancer_acl $LB_ACL_ID
|
||||
27
build/climc/root/opt/yunion/scripts/tools/clean_loadbalancer_certificate.sh
Executable file
27
build/climc/root/opt/yunion/scripts/tools/clean_loadbalancer_certificate.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
LB_CERT=$1
|
||||
|
||||
if [ -z "$LB_CERT" ]; then
|
||||
echo "Usage: $0 <loadbalancer_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LB_CERT_ID=$(climc lbcert-show $LB_CERT | grep -w " id " | awk '{print $4}')
|
||||
LB_CERT_NAME=$(climc lbcert-show $LB_CERT | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$LB_CERT_ID" ]; then
|
||||
echo "Loadbalancer certificate $LB_CERT_ID not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Ready to remove loadbalancer certificate $LB_CERT_NAME($LB_CERT_ID) ..."
|
||||
|
||||
clean_loadbalancer_cert() {
|
||||
local LID=$1
|
||||
climc lbcert-purge $LID
|
||||
}
|
||||
|
||||
clean_loadbalancer_cert $LB_CERT_ID
|
||||
96
build/climc/root/opt/yunion/scripts/tools/clean_provider.sh
Executable file
96
build/climc/root/opt/yunion/scripts/tools/clean_provider.sh
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
pushd $(dirname $BASH_SOURCE) > /dev/null
|
||||
CUR_DIR=$(pwd -P)
|
||||
popd > /dev/null
|
||||
|
||||
|
||||
PROVIDER=$1
|
||||
|
||||
if [ -z "$PROVIDER" ]; then
|
||||
echo "Usage: $0 <cloud-provider-id-or-name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PROVIDER_ID=$(climc cloud-provider-show $PROVIDER | grep -w " id " | awk '{print $4}')
|
||||
PROVIDER_NAME=$(climc cloud-provider-show $PROVIDER | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$PROVIDER_ID" ]; then
|
||||
echo "Cloud provider $PROVIDER not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
echo "Ready to clean cloud provider $PROVIDER_NAME($PROVIDER_ID)..."
|
||||
|
||||
echo "1. Disable cloud provider $PROVIDER_NAME($PROVIDER_ID) ..."
|
||||
|
||||
climc cloud-provider-disable $PROVIDER_ID
|
||||
|
||||
echo "2. Clean all hosts ..."
|
||||
|
||||
for hostid in $(climc host-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_host.sh $hostid
|
||||
done
|
||||
|
||||
echo "3. Clean all loadbalancer ..."
|
||||
|
||||
for lbid in $(climc lb-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_loadbalancer.sh $lbid
|
||||
done
|
||||
|
||||
echo "4. Clean all loadbalancer acl ..."
|
||||
|
||||
for lbaclid in $(climc lbacl-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_loadbalancer_acl.sh $lbaclid
|
||||
done
|
||||
|
||||
echo "5. Clean all loadbalancer certificate ..."
|
||||
|
||||
for lbcertid in $(climc lbcert-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_loadbalancer_certificate.sh $lbcertid
|
||||
done
|
||||
|
||||
echo "6. Clean all vpc ..."
|
||||
|
||||
for vpcid in $(climc vpc-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_vpc.sh $vpcid
|
||||
done
|
||||
|
||||
echo "7. Clean all eips ..."
|
||||
for eipid in $(climc eip-list --admin --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_eip.sh $eipid
|
||||
done
|
||||
|
||||
echo "8. Clean all snapshots ..."
|
||||
for snapid in $(climc snapshot-list --admin --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
echo "to clean snapshot $snapid ..."
|
||||
$CUR_DIR/clean_snapshot.sh $snapid
|
||||
done
|
||||
|
||||
echo "9. Clean all storagecache ..."
|
||||
|
||||
for cacheid in $(climc storage-cache-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_storagecache.sh $cacheid
|
||||
done
|
||||
|
||||
echo "10. Clean all storages ..."
|
||||
|
||||
for storeid in $(climc storage-list --manager $PROVIDER_ID --admin --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
$CUR_DIR/clean_storage.sh $storeid
|
||||
done
|
||||
|
||||
echo "Delete cloud provider ..."
|
||||
|
||||
climc cloud-provider-delete $PROVIDER_ID
|
||||
27
build/climc/root/opt/yunion/scripts/tools/clean_snapshot.sh
Executable file
27
build/climc/root/opt/yunion/scripts/tools/clean_snapshot.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
SNAPSHOT=$1
|
||||
|
||||
if [ -z "$SNAPSHOT" ]; then
|
||||
echo "Usage: $0 <snapshot_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SNAPSHOT_NAME=$(climc snapshot-show $SNAPSHOT | grep -w " name " | awk '{print $4}')
|
||||
SNAPSHOT_ID=$(climc snapshot-show $SNAPSHOT | grep -w " id " | awk '{print $4}')
|
||||
|
||||
if [ -z "$SNAPSHOT_ID" ]; then
|
||||
echo "Cannot find snapshot $SNAPSHOT_ID"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "To clean snapshot $SNAPSHOT_NAME($SNAPSHOT_ID)..."
|
||||
|
||||
clean_snapshot() {
|
||||
local SNAP_ID=$1
|
||||
climc snapshot-purge $SNAP_ID > /dev/null
|
||||
}
|
||||
|
||||
clean_snapshot $SNAPSHOT_ID
|
||||
34
build/climc/root/opt/yunion/scripts/tools/clean_storage.sh
Executable file
34
build/climc/root/opt/yunion/scripts/tools/clean_storage.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
STORAGE=$1
|
||||
|
||||
if [ -z "$STORAGE" ]; then
|
||||
echo "Usage: $0 <storage_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
STORAGE_ID=$(climc storage-show $STORAGE | grep -w " id " | awk '{print $4}')
|
||||
STORAGE_NAME=$(climc storage-show $STORAGE | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$STORAGE_ID" ]; then
|
||||
echo "Storage $STORAGE not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Clean disks on storage $STORAGE_NAME($STORAGE_ID) ..."
|
||||
|
||||
for disk_id in $(climc disk-list --admin --storage $STORAGE_ID --show-emulated --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc disk-purge $disk_id > /dev/null
|
||||
done
|
||||
|
||||
for disk_id in $(climc disk-list --admin --storage $STORAGE_ID --show-emulated --pending-delete --limit 2048 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc disk-purge $disk_id > /dev/null
|
||||
done
|
||||
|
||||
# CACHE_ID=$(climc storage-show $STORAGE_ID | grep -w " storagecache_id " | awk '{print $4}')
|
||||
|
||||
climc storage-delete $STORAGE_ID > /dev/null
|
||||
28
build/climc/root/opt/yunion/scripts/tools/clean_storagecache.sh
Executable file
28
build/climc/root/opt/yunion/scripts/tools/clean_storagecache.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
CACHE=$1
|
||||
|
||||
if [ -z "$CACHE" ]; then
|
||||
echo "Usage: $0 <storage_cache_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CACHE_ID=$(climc storage-cache-show $CACHE | grep -w " id " | awk '{print $4}')
|
||||
CACHE_NAME=$(climc storage-cache-show $CACHE | grep -w " name " | awk '{print $4}')
|
||||
|
||||
if [ -z "$CACHE_ID" ]; then
|
||||
echo "Storage cache $CACHE not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Ready to remove storagecache $CACHE_NAME($CACHE_ID) ..."
|
||||
|
||||
for imgid in $(climc storage-cached-image-list --storagecache $CACHE_ID --show-emulated --limit 0 | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $4}')
|
||||
do
|
||||
climc storagecache-uncache-image $CACHE_ID $imgid --force # > /dev/null
|
||||
done
|
||||
|
||||
climc storage-cache-delete $CACHE_ID > /dev/null
|
||||
|
||||
55
build/climc/root/opt/yunion/scripts/tools/clean_vpc.sh
Executable file
55
build/climc/root/opt/yunion/scripts/tools/clean_vpc.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
VPC=$1
|
||||
|
||||
if [ -z "$VPC" ]; then
|
||||
echo "Usage: $0 <vpc_id_or_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VPC_NAME=$(climc vpc-show $VPC | grep -w " name " | awk '{print $4}')
|
||||
VPC_ID=$(climc vpc-show $VPC | grep -w " id " | awk '{print $4}')
|
||||
|
||||
if [ -z "$VPC_ID" ]; then
|
||||
echo "Cannot find vpc $VPC"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "To clean vpc $VPC_NAME($VPC_ID)..."
|
||||
|
||||
clean_network() {
|
||||
climc network-purge $1 > /dev/null
|
||||
}
|
||||
|
||||
|
||||
clean_wire() {
|
||||
local WIRE_ID=$1
|
||||
for net_id in $(climc network-list --admin --wire $WIRE_ID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
clean_network $net_id
|
||||
done
|
||||
climc wire-delete $wire_id > /dev/null
|
||||
}
|
||||
|
||||
clean_vpc() {
|
||||
local VPC_ID=$1
|
||||
climc vpc-purge $VPC_ID > /dev/null
|
||||
}
|
||||
|
||||
echo "1. Clean wires ..."
|
||||
|
||||
for wire_id in $(climc wire-list --vpc $VPC_ID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
clean_wire $wire_id
|
||||
done
|
||||
|
||||
echo "2. Clean route tables ..."
|
||||
for routetable_id in $(climc routetable-list --vpc $VPC_ID --show-emulated | egrep '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' | awk '{print $2}')
|
||||
do
|
||||
climc routetable-purge $routetable_id >/dev/null
|
||||
done
|
||||
|
||||
echo "3. clean vpc ..."
|
||||
clean_vpc $VPC_ID
|
||||
@@ -1,3 +1,5 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/climc-base:latest
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/climc-base:v20200308
|
||||
|
||||
ADD ./build/climc/root/opt /opt
|
||||
|
||||
ADD ./_output/bin/climc ./_output/bin/*cli /opt/yunion/bin/
|
||||
|
||||
@@ -6,7 +6,7 @@ ENV TZ Asia/Shanghai
|
||||
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
|
||||
RUN apk add --no-cache bash bash-completion tzdata ca-certificates && \
|
||||
RUN apk add --no-cache bash bash-completion tzdata ca-certificates vim && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.0.1
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/host-base:v0.1.0
|
||||
|
||||
MAINTAINER "Yaoqi Wan wanyaoqi@yunionyun.com"
|
||||
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
RUN apk add librados librbd
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
|
||||
ADD ./_output/bin/host /opt/yunion/bin/host
|
||||
ADD ./_output/bin/.host.bin /opt/yunion/bin/.host.bin
|
||||
ADD ./_output/bin/bundles/host /opt/yunion/bin/bundles/host
|
||||
ADD ./_output/alpine-build/bin/host /opt/yunion/bin/host
|
||||
|
||||
4
build/docker/Dockerfile.monitor
Normal file
4
build/docker/Dockerfile.monitor
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/onecloud-base:latest
|
||||
|
||||
ADD ./_output/bin/monitor /opt/yunion/bin/monitor
|
||||
|
||||
6
build/docker/Dockerfile.vpcagent
Normal file
6
build/docker/Dockerfile.vpcagent
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM registry.cn-beijing.aliyuncs.com/yunionio/openvswitch:2.9.6-1
|
||||
|
||||
MAINTAINER "Yousong Zhou <zhouyousong@yunion.cn>"
|
||||
|
||||
RUN mkdir -p /opt/yunion/bin
|
||||
ADD ./_output/alpine-build/bin/vpcagent /opt/yunion/bin/vpcagent
|
||||
@@ -35,6 +35,7 @@ import (
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/cloudnet"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/etcd"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/k8s"
|
||||
_ "yunion.io/x/onecloud/cmd/climc/shell/monitor"
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
|
||||
@@ -99,6 +99,9 @@ func init() {
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.(*jsonutils.JSONDict).Add(options, "options")
|
||||
}
|
||||
@@ -164,8 +167,8 @@ func init() {
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFileAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFileAccount), "billing_file_account")
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.Add(options, "options")
|
||||
@@ -308,6 +311,9 @@ func init() {
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.Add(options, "options")
|
||||
}
|
||||
@@ -318,6 +324,9 @@ func init() {
|
||||
if args.RemoveOptionsBillingBucketAccount {
|
||||
removeOptions = append(removeOptions, "billing_bucket_account")
|
||||
}
|
||||
if args.RemoveOptionsBillingFilePrefix {
|
||||
removeOptions = append(removeOptions, "billing_file_prefix")
|
||||
}
|
||||
if len(removeOptions) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(removeOptions), "remove_options")
|
||||
}
|
||||
@@ -382,8 +391,8 @@ func init() {
|
||||
if len(args.OptionsBillingBucketAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account")
|
||||
}
|
||||
if len(args.OptionsBillingFileAccount) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFileAccount), "billing_file_account")
|
||||
if len(args.OptionsBillingFilePrefix) > 0 {
|
||||
options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.Add(options, "options")
|
||||
@@ -395,8 +404,8 @@ func init() {
|
||||
if args.RemoveOptionsBillingBucketAccount {
|
||||
removeOptions = append(removeOptions, "billing_bucket_account")
|
||||
}
|
||||
if args.RemoveOptionsBillingFileAccount {
|
||||
removeOptions = append(removeOptions, "billing_file_account")
|
||||
if args.RemoveOptionsBillingFilePrefix {
|
||||
removeOptions = append(removeOptions, "billing_file_prefix")
|
||||
}
|
||||
if len(removeOptions) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(removeOptions), "remove_options")
|
||||
|
||||
@@ -29,11 +29,11 @@ func init() {
|
||||
* 操作用户的通信地址(如果用户的通信地址不存在则进行添加;如果已存在则进行修改;如果设置空则进行删除。)
|
||||
*/
|
||||
type ContactsUpdateOptions struct {
|
||||
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
|
||||
CONTACTTYPE string `help:"The contact type email|mobile" choices:"email|mobile|dingtalk"`
|
||||
CONTACT string `help:"The contacts details mobile number or email address or dingtalk's userid, if set it the empty str means delete"`
|
||||
Status string `help:"Enabled or disabled contact status" choices:"enable|disable"`
|
||||
UpdateDingtalk bool `help:"if update dingtalk"`
|
||||
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
|
||||
CONTACTTYPE string `help:"The contact type email|mobile" choices:"email|mobile|dingtalk"`
|
||||
CONTACT string `help:"The contacts details mobile number or email address or dingtalk's userid, if set it the empty str means delete"`
|
||||
Status string `help:"Enabled or disabled contact status" choices:"enable|disable"`
|
||||
Pull string `help:"pull some subcontacts(e.g., dingtalk, feishu, etc) related to mobile"`
|
||||
}
|
||||
R(&ContactsUpdateOptions{}, "contact-update", "Create, delete or update contact for user", func(s *mcclient.ClientSession, args *ContactsUpdateOptions) error {
|
||||
arr := jsonutils.NewArray()
|
||||
@@ -52,12 +52,8 @@ func init() {
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(arr, "contacts")
|
||||
if args.UpdateDingtalk {
|
||||
params.Add(jsonutils.JSONTrue, "update_dingtalk")
|
||||
}
|
||||
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
|
||||
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", args.Pull, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -66,6 +62,21 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type ContactsPullOptions struct {
|
||||
UID string `help:"The user you wanna pull contact"`
|
||||
CONTACTTYPE string `help:"The contact type"`
|
||||
}
|
||||
R(&ContactsPullOptions{}, "contact-pull", "Pull contact", func(s *mcclient.ClientSession, args *ContactsPullOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("contacts", jsonutils.NewArray())
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", args.CONTACTTYPE, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(contact)
|
||||
return nil
|
||||
})
|
||||
|
||||
type ContactsDeleteOptions struct {
|
||||
UID string `help:"The user you wanna add contact to (Keystone User ID)"`
|
||||
CONTACTTYPE string `help:"The contact type email|mobile|dingtalk" choices:"email|mobile|dingtalk"`
|
||||
@@ -78,7 +89,7 @@ func init() {
|
||||
arr.Add(tmpObj)
|
||||
params := jsonutils.NewDict()
|
||||
params.Add(arr, "contacts")
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", params)
|
||||
contact, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "update-contact", "", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -169,7 +180,7 @@ func init() {
|
||||
tmpDict := jsonutils.NewDict()
|
||||
tmpDict.Add(jsonutils.NewString(args.CONTACT_TYPE), "contact_type")
|
||||
tmpDict.Add(jsonutils.NewString(args.CONTACT), "contact")
|
||||
_, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "verify", tmpDict)
|
||||
_, err := modules.Contacts.CustomizedPerformAction(s, args.UID, "verify", "", tmpDict)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
users, err := modules.Groups.GetUsers(s, grpId)
|
||||
users, err := modules.Groups.GetUsers(s, grpId, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -18,11 +18,13 @@ import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/ssh"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -55,6 +57,8 @@ func init() {
|
||||
|
||||
CdromBoot *bool `help:"filter hosts list by cdrom_boot=true|false"`
|
||||
|
||||
Sn string `help:"find host by sn"`
|
||||
|
||||
options.BaseListOptions
|
||||
}
|
||||
R(&HostListOptions{}, "host-list", "List hosts", func(s *mcclient.ClientSession, opts *HostListOptions) error {
|
||||
@@ -76,6 +80,9 @@ func init() {
|
||||
if len(opts.Uuid) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Uuid), "uuid")
|
||||
}
|
||||
if len(opts.Sn) > 0 {
|
||||
params.Add(jsonutils.NewString(opts.Sn), "sn")
|
||||
}
|
||||
result, err := modules.Hosts.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -659,4 +666,44 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
type HostSSHLoginOptions struct {
|
||||
ID string `help:"ID or name of host"`
|
||||
Port int `help:"SSH service port" default:"22"`
|
||||
}
|
||||
R(&HostSSHLoginOptions{}, "host-ssh", "SSH login of a host", func(s *mcclient.ClientSession, args *HostSSHLoginOptions) error {
|
||||
srvid, e := modules.Hosts.GetId(s, args.ID, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
i, e := modules.Hosts.GetLoginInfo(s, srvid, nil)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
host, err := i.GetString("ip")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
user, err := i.GetString("username")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
passwd, err := i.GetString("password")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
port := 22
|
||||
if args.Port != 22 {
|
||||
port = args.Port
|
||||
}
|
||||
sshCli, err := ssh.NewClient(host, port, user, passwd, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("ssh %s:%d", host, port)
|
||||
if err := sshCli.RunTerminal(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
69
cmd/climc/shell/monitor/alert.go
Normal file
69
cmd/climc/shell/monitor/alert.go
Normal file
@@ -0,0 +1,69 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
|
||||
)
|
||||
|
||||
func init() {
|
||||
aN := cmdN("alert")
|
||||
R(&options.AlertListOptions{}, aN("list"), "List all alerts",
|
||||
func(s *mcclient.ClientSession, args *options.AlertListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.Alerts.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(ret, monitor.Alerts.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.AlertShowOptions{}, aN("show"), "Show details of a alert rule",
|
||||
func(s *mcclient.ClientSession, args *options.AlertShowOptions) error {
|
||||
ret, err := monitor.Alerts.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.AlertUpdateOptions{}, aN("update"), "Update a alert rule",
|
||||
func(s *mcclient.ClientSession, args *options.AlertUpdateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.Alerts.Update(s, args.ID, params.JSON(params))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.AlertDeleteOptions{}, aN("delete"), "Delete alerts",
|
||||
func(s *mcclient.ClientSession, args *options.AlertDeleteOptions) error {
|
||||
ret := monitor.Alerts.BatchDelete(s, args.ID, nil)
|
||||
printBatchResults(ret, monitor.Alerts.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
27
cmd/climc/shell/monitor/common.go
Normal file
27
cmd/climc/shell/monitor/common.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/cmd/climc/shell"
|
||||
"yunion.io/x/onecloud/pkg/util/printutils"
|
||||
)
|
||||
|
||||
var (
|
||||
R = shell.R
|
||||
printList = printutils.PrintJSONList
|
||||
printObject = printutils.PrintJSONObject
|
||||
printBatchResults = printutils.PrintJSONBatchResults
|
||||
)
|
||||
56
cmd/climc/shell/monitor/monitor.go
Normal file
56
cmd/climc/shell/monitor/monitor.go
Normal file
@@ -0,0 +1,56 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 monitor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
|
||||
)
|
||||
|
||||
func cmdN(suffix string) func(action string) string {
|
||||
return func(action string) string {
|
||||
return fmt.Sprintf("monitor-%s-%s", suffix, action)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
dsN := cmdN("datasource")
|
||||
R(&options.DataSourceListOptions{}, dsN("list"), "List all monitor data source",
|
||||
func(s *mcclient.ClientSession, args *options.DataSourceListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.DataSources.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(ret, monitor.DataSources.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.DataSourceDeleteOptions{}, dsN("delete"), "Delete monitor data source",
|
||||
func(s *mcclient.ClientSession, args *options.DataSourceDeleteOptions) error {
|
||||
ret, err := monitor.DataSources.Delete(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
99
cmd/climc/shell/monitor/notification.go
Normal file
99
cmd/climc/shell/monitor/notification.go
Normal file
@@ -0,0 +1,99 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 monitor
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/monitor"
|
||||
options "yunion.io/x/onecloud/pkg/mcclient/options/monitor"
|
||||
)
|
||||
|
||||
func init() {
|
||||
nN := cmdN("notification")
|
||||
R(&options.NotificationListOptions{}, nN("list"), "List all alert notification",
|
||||
func(s *mcclient.ClientSession, args *options.NotificationListOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.Notifications.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printList(ret, monitor.Notifications.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.NotificationDingDingCreateOptions{}, nN("create-dingding"),
|
||||
"Create dingding alert notification",
|
||||
func(s *mcclient.ClientSession, args *options.NotificationDingDingCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.Notifications.Create(s, params.JSON(params))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.NotificationFeishuCreateOptions{}, nN("create-feishu"),
|
||||
"Create feishu alert notification",
|
||||
func(s *mcclient.ClientSession, args *options.NotificationFeishuCreateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.Notifications.Create(s, params.JSON(params))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.NotificationShowOptions{}, nN("show"), "Show alert notification",
|
||||
func(s *mcclient.ClientSession, args *options.NotificationShowOptions) error {
|
||||
ret, err := monitor.Notifications.Get(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.NotificationUpdateOptions{}, nN("update"), "Update alert notification",
|
||||
func(s *mcclient.ClientSession, args *options.NotificationUpdateOptions) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ret, err := monitor.Notifications.Update(s, args.ID, params.JSON(params))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.NotificationDeleteOptions{}, nN("delete"), "Show delete notification",
|
||||
func(s *mcclient.ClientSession, args *options.NotificationDeleteOptions) error {
|
||||
ret := monitor.Notifications.BatchDelete(s, args.ID, nil)
|
||||
printBatchResults(ret, monitor.Notifications.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -59,18 +59,18 @@ func init() {
|
||||
* 修改指定的报警规则
|
||||
*/
|
||||
type NodealertUpdateOptions struct {
|
||||
ID string `help:"ID of the alert rule" required:"true" positional:"true"`
|
||||
Type string `help:"Alert rule type" choices:"guest|host"`
|
||||
Metric string `help:"Metric name, include measurement and field, such as vm_cpu.usage_active"`
|
||||
NodeName string `help:"Name of the guest or host"`
|
||||
NodeID string `help:"ID of the guest or host"`
|
||||
Period string `help:"Specify the query time period for the data"`
|
||||
Window string `help:"Specify the query interval for the data"`
|
||||
Threshold float64 `help:"Threshold value of the metric"`
|
||||
Comparator string `help:"Comparison operator for join expressions" choices:">|<|>=|<=|=|!="`
|
||||
Recipients string `help:"Comma separated recipient ID"`
|
||||
Level string `help:"Alert level" choices:"normal|important|fatal"`
|
||||
Channel string `help:"Ways to send an alarm" choices:"email|mobile"`
|
||||
ID string `help:"ID of the alert rule" required:"true" positional:"true"`
|
||||
Type string `help:"Alert rule type" choices:"guest|host"`
|
||||
Metric string `help:"Metric name, include measurement and field, such as vm_cpu.usage_active"`
|
||||
NodeName string `help:"Name of the guest or host"`
|
||||
NodeID string `help:"ID of the guest or host"`
|
||||
Period string `help:"Specify the query time period for the data"`
|
||||
Window string `help:"Specify the query interval for the data"`
|
||||
Threshold *float64 `help:"Threshold value of the metric"`
|
||||
Comparator string `help:"Comparison operator for join expressions" choices:">|<|>=|<=|=|!="`
|
||||
Recipients string `help:"Comma separated recipient ID"`
|
||||
Level string `help:"Alert level" choices:"normal|important|fatal"`
|
||||
Channel string `help:"Ways to send an alarm" choices:"email|mobile"`
|
||||
}
|
||||
R(&NodealertUpdateOptions{}, "nodealert-update", "Update the node alert rule", func(s *mcclient.ClientSession, args *NodealertUpdateOptions) error {
|
||||
params, err := options.StructToParams(args)
|
||||
@@ -92,14 +92,11 @@ func init() {
|
||||
* 删除指定ID的报警规则
|
||||
*/
|
||||
type NodealertDeleteOptions struct {
|
||||
ID string `help:"ID of node alert" required:"true" positional:"true"`
|
||||
ID []string `help:"ID of node alert" required:"true" positional:"true"`
|
||||
}
|
||||
R(&NodealertDeleteOptions{}, "nodealert-delete", "Delete a node alert", func(s *mcclient.ClientSession, args *NodealertDeleteOptions) error {
|
||||
alarm, err := modules.NodeAlert.Delete(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(alarm)
|
||||
ret := modules.NodeAlert.BatchDelete(s, args.ID, nil)
|
||||
printBatchResults(ret, modules.NodeAlert.GetColumns(s))
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ func init() {
|
||||
*/
|
||||
|
||||
type NotificationCreateOptions struct {
|
||||
CONTACTTYPE string `help:"User's contacts type" choices:"email|mobile|dingtalk|webconsole"`
|
||||
CONTACTTYPE string `help:"User's contacts type"`
|
||||
TOPIC string `help:"Title or topic of the notification"`
|
||||
PRIORITY string `help:"Priority of the notification" choices:"normal|important|fatal"`
|
||||
MSG string `help:"The content of the notification"`
|
||||
|
||||
@@ -34,7 +34,24 @@ func init() {
|
||||
}
|
||||
body := jsonutils.NewDict()
|
||||
body.Add(tmp, args.CONTACTTYPE)
|
||||
modules.Configs.Create(s, body)
|
||||
ret, err := modules.Configs.Create(s, body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
R(&ConfigCreate2Options{}, "notify-config-validate", "config validate", func(s *mcclient.ClientSession,
|
||||
args *ConfigCreate2Options) error {
|
||||
tmp := jsonutils.NewDict()
|
||||
for i := 0; i+1 < len(args.CONFIGS); i += 2 {
|
||||
tmp.Add(jsonutils.NewString(args.CONFIGS[i+1]), args.CONFIGS[i])
|
||||
}
|
||||
ret, err := modules.Configs.PerformAction(s, args.CONTACTTYPE, "validate", tmp)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(ret)
|
||||
return nil
|
||||
})
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/options"
|
||||
"yunion.io/x/onecloud/pkg/util/fileutils2"
|
||||
"yunion.io/x/onecloud/pkg/util/ssh"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -1218,4 +1219,77 @@ func init() {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&options.ServerSSHLoginOptions{}, "server-ssh", "Use SSH login a server", func(s *mcclient.ClientSession, opts *options.ServerSSHLoginOptions) error {
|
||||
srv, err := modules.Servers.Get(s, opts.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
srvid, err := srv.GetString("id")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
address := make([]string, 0)
|
||||
nics, err := srv.GetArray("nics")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, nic := range nics {
|
||||
if addr, err := nic.GetString("ip_addr"); err == nil {
|
||||
address = append(address, addr)
|
||||
}
|
||||
}
|
||||
if len(address) == 0 {
|
||||
return fmt.Errorf("Not found ip address from server %s", opts.ID)
|
||||
}
|
||||
|
||||
params := jsonutils.NewDict()
|
||||
if len(opts.Key) > 0 {
|
||||
privateKey, e := ioutil.ReadFile(opts.Key)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
params.Add(jsonutils.NewString(string(privateKey)), "private_key")
|
||||
}
|
||||
|
||||
i, e := modules.Servers.GetLoginInfo(s, srvid, params)
|
||||
if e != nil {
|
||||
return e
|
||||
}
|
||||
passwd, err := i.GetString("password")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if opts.Password != "" {
|
||||
passwd = opts.Password
|
||||
}
|
||||
user, err := i.GetString("username")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if opts.User != "" {
|
||||
user = opts.User
|
||||
}
|
||||
|
||||
host := address[0]
|
||||
if opts.Host != "" {
|
||||
host = opts.Host
|
||||
}
|
||||
port := 22
|
||||
if opts.Port != 22 {
|
||||
port = opts.Port
|
||||
}
|
||||
|
||||
sshCli, err := ssh.NewClient(host, port, user, passwd, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Infof("ssh %s:%d", host, port)
|
||||
if err := sshCli.RunTerminal(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
package shell
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
@@ -45,6 +46,9 @@ func init() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if decodeStr, err := base64.StdEncoding.DecodeString(connParams); err == nil {
|
||||
connParams = string(decodeStr)
|
||||
}
|
||||
var query url.Values
|
||||
connUrl, err := url.ParseRequestURI(connParams)
|
||||
if err == nil {
|
||||
@@ -64,7 +68,9 @@ func init() {
|
||||
return nil
|
||||
}
|
||||
|
||||
u.RawQuery = connParams
|
||||
newQuery := url.Values(make(map[string][]string))
|
||||
newQuery.Set("data", base64.StdEncoding.EncodeToString([]byte(connParams)))
|
||||
u.RawQuery = newQuery.Encode()
|
||||
fmt.Println(u.String())
|
||||
return nil
|
||||
}
|
||||
|
||||
23
cmd/monitor/main.go
Normal file
23
cmd/monitor/main.go
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 main
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/monitor/service"
|
||||
)
|
||||
|
||||
func main() {
|
||||
service.StartService()
|
||||
}
|
||||
14
go.mod
14
go.mod
@@ -3,6 +3,7 @@ module yunion.io/x/onecloud
|
||||
go 1.12
|
||||
|
||||
require (
|
||||
cloud.google.com/go v0.38.0
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0
|
||||
github.com/Azure/azure-sdk-for-go v36.1.0+incompatible
|
||||
github.com/Azure/go-autorest v10.15.5+incompatible
|
||||
@@ -22,6 +23,7 @@ require (
|
||||
github.com/aokoli/goutils v1.0.1
|
||||
github.com/aws/aws-sdk-go v1.21.4
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
|
||||
github.com/benbjohnson/clock v1.0.0
|
||||
github.com/bitly/go-simplejson v0.5.0
|
||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
|
||||
github.com/c-bata/go-prompt v0.2.1
|
||||
@@ -100,6 +102,7 @@ require (
|
||||
github.com/shirou/gopsutil v2.18.10+incompatible
|
||||
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
|
||||
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9
|
||||
github.com/smartystreets/goconvey v1.6.4
|
||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.3 // indirect
|
||||
github.com/stretchr/testify v1.4.0
|
||||
@@ -117,10 +120,13 @@ require (
|
||||
go.uber.org/atomic v1.4.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
|
||||
golang.org/x/net v0.0.0-20191007182048-72f939374954
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987
|
||||
google.golang.org/api v0.13.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
|
||||
google.golang.org/grpc v1.23.1
|
||||
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
|
||||
@@ -134,12 +140,12 @@ require (
|
||||
k8s.io/client-go v9.0.0+incompatible
|
||||
k8s.io/klog v0.1.0 // indirect
|
||||
k8s.io/kubernetes v1.12.3
|
||||
yunion.io/x/executor v0.0.0-20191202093616-92e2e6119257
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74
|
||||
yunion.io/x/jsonutils v0.0.0-20200113074440-9297fd00ba07
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
|
||||
yunion.io/x/pkg v0.0.0-20200103043034-27c6f82160fa
|
||||
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v0.0.0-20200119074814-09089d67c78d
|
||||
yunion.io/x/sqlchemy v0.0.0-20200221103553-6a98f7f8ab92
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
|
||||
)
|
||||
|
||||
|
||||
45
go.sum
45
go.sum
@@ -3,6 +3,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
|
||||
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
|
||||
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0 h1:43rak9uafmwSJpXfFO1heKQph8tP3nlfWJWFQQtW1R0=
|
||||
github.com/360EntSecGroup-Skylar/excelize v1.4.0/go.mod h1:R8KYLmGns0vDPe6/HyphW0mzW+MFexlGDafU0ykVEnU=
|
||||
github.com/Azure/azure-sdk-for-go v5.0.0-beta.0.20161118192335-3b1282355199+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
@@ -78,6 +80,8 @@ github.com/aws/aws-sdk-go v1.21.4 h1:1xB+x6Dzev8ETmeHEiSfUVbIzmC/0EyFfXMkJpzKPCE
|
||||
github.com/aws/aws-sdk-go v1.21.4/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA=
|
||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
|
||||
github.com/benbjohnson/clock v1.0.0 h1:78Jk/r6m4wCi6sndMpty7A//t4dw/RW5fV4ZgDVfX1w=
|
||||
github.com/benbjohnson/clock v1.0.0/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
|
||||
@@ -217,12 +221,16 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY=
|
||||
github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM=
|
||||
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
|
||||
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4 h1:hU4mGcQI4DaAYW+IbTun+2qEZVFxK0ySjQLTbS0VQKc=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
|
||||
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||
github.com/googollee/go-engine.io v0.0.0-20180829091931-e2f255711dcb h1:n22Aukg/TjoypWc37dbKIpCsz0VMFPD36HQk1WKvg3A=
|
||||
@@ -256,7 +264,10 @@ github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1
|
||||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
|
||||
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead h1:Y9WOGZY2nw5ksbEf5AIpk+vK52Tdg/VN/rHFRfEeeGQ=
|
||||
github.com/hako/durafmt v0.0.0-20180520121703-7b7ae1e72ead/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE=
|
||||
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
|
||||
github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0=
|
||||
@@ -441,6 +452,8 @@ github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbm
|
||||
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a h1:pa8hGb/2YqsZKovtsgrwcDH1RZhVbTKCjLp47XpqCDs=
|
||||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd h1:p5kvxG4NHogJX1brTLtvUSGdW0/aBvIyqDSW7tmnsmQ=
|
||||
github.com/smartystreets/gunit v0.0.0-20180314194857-6f0d6275bdcd/go.mod h1:XUKj4gbqj2QvJk/OdLWzyZ3FYli0f+MdpngyryX0gcw=
|
||||
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
|
||||
@@ -503,7 +516,10 @@ go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738 h1:lWF4f9Nypl1ZqSb4gLeh/DGvBYVaUYHuiB93teOmwgc=
|
||||
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.opencensus.io v0.20.1 h1:pMEjRZ1M4ebWGikflH7nQpV6+Zr88KBMA2XJD3sbijw=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
@@ -528,6 +544,7 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -541,6 +558,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
|
||||
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190419010253-1f3472d942ba/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65 h1:+rhAzEzT3f4JtomfC371qB+0Ola2caSKcY69NUBZrRQ=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
@@ -552,6 +570,8 @@ golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -576,6 +596,7 @@ golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190418153312-f0ce4c0180be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606122018-79a91cf218c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190830023255-19e00faab6ad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -599,23 +620,36 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.zx2c4.com/wireguard v0.0.20190908 h1:SUoXDdwSMtomLdvke+zz83/u9tNvl4hHmcTIWp38tow=
|
||||
golang.zx2c4.com/wireguard v0.0.20190908/go.mod h1:LhfXh5z6bLC2lW2ve6BzYZFwnnsXK3OQjySR0Yh2dO8=
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987 h1:26OAgqBTufVr8WKonCEhhjO1oKsYhHv0iM5Dg92G1TM=
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20191008142428-8d021180e987/go.mod h1:7hq1rEDsx7/FWl8IEEnfH2Xhs6M2MNnjUfN0PeI8Rm0=
|
||||
google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107 h1:xtNn7qFlagY2mQNFHMSRPjT2RkOV4OXM7P5TVy9xATo=
|
||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 h1:nfPFGzJkUDX6uBmpN/pSw7MbOAWegH5QDQuoXFHedLg=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk=
|
||||
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
@@ -649,6 +683,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76 h1:cGc6jt7tNK7a2WfgNKjxjoU/UXXr9Q7JTqvCupZ+6+Y=
|
||||
k8s.io/api v0.0.0-20181004124137-fd83cbc87e76/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
|
||||
@@ -662,8 +697,8 @@ k8s.io/kubernetes v1.12.3 h1:5GPfYyyBylqcZUqL+ApYpYTm2IYjH56JUewYC0GbetU=
|
||||
k8s.io/kubernetes v1.12.3/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
|
||||
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
yunion.io/x/executor v0.0.0-20191202093616-92e2e6119257 h1:LZ6eC1uoLDAp7NQlaCy+DKnF31Mgd3LDKlIithziEmY=
|
||||
yunion.io/x/executor v0.0.0-20191202093616-92e2e6119257/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74 h1:A15C6VdVRWvmQ9pAJHrUs9yan5qKlYH7uaRxHg1kRbk=
|
||||
yunion.io/x/executor v0.0.0-20200227030256-a18417815e74/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051 h1:vtZw2iwGrsARNSwRTREGjmr2BWPdxbmXVkb3kI1qu28=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
yunion.io/x/jsonutils v0.0.0-20200113074440-9297fd00ba07 h1:i6Im3w4UoyCIKOEtr0Y3aAPGrL9FYAzeFXoj3daXXt0=
|
||||
@@ -677,9 +712,11 @@ yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZV
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200103043034-27c6f82160fa h1:+7zYi8MhaOW/53/7FOERnhQqAU4UhgaOVIS+AMzTKNU=
|
||||
yunion.io/x/pkg v0.0.0-20200103043034-27c6f82160fa/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070 h1:rKnYgtvMHKmzPEUTkyNjyKOG7wzjpUvI7fcZwLNGQXw=
|
||||
yunion.io/x/pkg v0.0.0-20200302034534-fdf44d54b070/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200119074814-09089d67c78d h1:z9gliVPaZir4qJ9/E1ItnqCZeMq1thGbcuRwYeSKgQM=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200119074814-09089d67c78d/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200221103553-6a98f7f8ab92 h1:Iz70/alKMAW3KeePhmExuhWsYw1MGTcMr5ewAL5lj1I=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200221103553-6a98f7f8ab92/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3 h1:bfC8EhXYvyGYldRWlzxiCM39Zfj3s3+zham9mW2h2LE=
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
@@ -117,21 +117,24 @@ func rpcHandler(ctx context.Context, w http.ResponseWriter, req *http.Request) {
|
||||
v, ok := retobj.Interface().(jsonutils.JSONObject)
|
||||
if ok {
|
||||
appsrv.SendJSON(w, v)
|
||||
return
|
||||
}
|
||||
|
||||
v2, ok := retobj.Interface().([]modulebase.SubmitResult)
|
||||
if ok {
|
||||
w.WriteHeader(207)
|
||||
appsrv.SendJSON(w, modulebase.SubmitResults2JSON(v2))
|
||||
} else {
|
||||
httperrors.BadGatewayError(w, "recv invalid data")
|
||||
return
|
||||
}
|
||||
|
||||
httperrors.BadGatewayError(w, "recv invalid data")
|
||||
} else {
|
||||
v, ok := reterr.Interface().(*httputils.JSONClientError)
|
||||
if ok {
|
||||
httperrors.JsonClientError(w, v)
|
||||
} else {
|
||||
httperrors.BadGatewayError(w, fmt.Sprintf("%s", reterr.Interface()))
|
||||
return
|
||||
}
|
||||
|
||||
httperrors.BadGatewayError(w, fmt.Sprintf("%s", reterr.Interface()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,16 @@ package cloudprovider
|
||||
|
||||
// SGeographicInfo is an autogenerated struct via yunion.io/x/onecloud/pkg/cloudprovider.SGeographicInfo.
|
||||
type SGeographicInfo struct {
|
||||
Latitude float32 `json:"latitude"`
|
||||
Longitude float32 `json:"longitude"`
|
||||
City string `json:"city"`
|
||||
CountryCode string `json:"country_code"`
|
||||
// 纬度
|
||||
// example: 26.647003
|
||||
Latitude float32 `json:"latitude"`
|
||||
// 经度
|
||||
// example: 106.630211
|
||||
Longitude float32 `json:"longitude"`
|
||||
// 城市
|
||||
// example: Guiyang
|
||||
City string `json:"city"`
|
||||
// 国家代码
|
||||
// example: CN
|
||||
CountryCode string `json:"country_code"`
|
||||
}
|
||||
|
||||
@@ -231,6 +231,9 @@ type BaremetalDiskConfig struct {
|
||||
}
|
||||
|
||||
type ServerConfigs struct {
|
||||
// 调度使用指定的云账号
|
||||
PreferManager string `json:"prefer_manager_id"`
|
||||
|
||||
// 调度到指定区域,优先级低于prefer_zone_id
|
||||
PreferRegion string `json:"prefer_region_id"`
|
||||
|
||||
@@ -354,6 +357,9 @@ type ServerCreateInput struct {
|
||||
// required: false
|
||||
UserData string `json:"user_data"`
|
||||
|
||||
// swagger:ignore
|
||||
Keypair string `json:"keypair" deprecated-by:"keypair_id"`
|
||||
|
||||
// 秘钥对Id
|
||||
// required: false
|
||||
KeypairId string `json:"keypair_id"`
|
||||
|
||||
26
pkg/apis/compute/baremetalagent.go
Normal file
26
pkg/apis/compute/baremetalagent.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type BaremetalagentDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SBaremetalagent
|
||||
|
||||
// 裸金属代理程序所在的可用区
|
||||
// example: zone1
|
||||
Zone string `json:"zone"`
|
||||
}
|
||||
@@ -49,10 +49,13 @@ type BucketCreateInput struct {
|
||||
StorageClass string `json:"storage_class"`
|
||||
}
|
||||
|
||||
type BucketDetail struct {
|
||||
apis.Meta
|
||||
type BucketDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SBucket
|
||||
CloudproviderDetails
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
AccessUrls []cloudprovider.SBucketAccessUrl `json:"access_urls"`
|
||||
}
|
||||
|
||||
type BucketObjectsActionInput struct {
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
|
||||
package compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CachedImageUncacheImageInput struct {
|
||||
// 存储缓存名Id
|
||||
// required: true
|
||||
@@ -23,3 +25,31 @@ type CachedImageUncacheImageInput struct {
|
||||
// default: false
|
||||
IsForce bool `json:"is_force"`
|
||||
}
|
||||
|
||||
type CachedimageDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SCachedimage
|
||||
|
||||
// 镜像状态, 和info里面的status一致
|
||||
// example: active
|
||||
Status string `json:"status"`
|
||||
|
||||
// 操作系统类型
|
||||
// example: FreeBSD
|
||||
OsType string `json:"os_type"`
|
||||
|
||||
// 操作系统发行版
|
||||
// example: FreeBSD
|
||||
OsDistribution string `json:"os_distribution"`
|
||||
|
||||
// 操作系统版本
|
||||
// example: 11
|
||||
OsVersion string `json:"os_version"`
|
||||
|
||||
// 虚拟化类型
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
|
||||
// 此镜像被使用次数
|
||||
// example: 0
|
||||
CachedCount int `json:"cached_count"`
|
||||
}
|
||||
|
||||
24
pkg/apis/compute/cachedloadbalanceracl.go
Normal file
24
pkg/apis/compute/cachedloadbalanceracl.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CachedLoadbalancerAclDetails struct {
|
||||
apis.SharableVirtualResourceDetails
|
||||
SCachedLoadbalancerAcl
|
||||
|
||||
CloudproviderInfo
|
||||
}
|
||||
24
pkg/apis/compute/cachedloadbalancercertificate.go
Normal file
24
pkg/apis/compute/cachedloadbalancercertificate.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CachedLoadbalancerCertificateDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SCachedLoadbalancerCertificate
|
||||
|
||||
CloudproviderInfo
|
||||
}
|
||||
@@ -106,3 +106,75 @@ type CloudaccountListInput struct {
|
||||
|
||||
CapabilityListInput
|
||||
}
|
||||
|
||||
type ProviderProject struct {
|
||||
// 子订阅项目名称
|
||||
// example: system
|
||||
Tenant string `json:"tenant"`
|
||||
|
||||
// 子订阅项目Id
|
||||
// 9a48383a-467a-4542-8b50-4e15b0a8715f
|
||||
TenantId string `json:"tenant_id"`
|
||||
}
|
||||
|
||||
type CloudaccountDetail struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SCloudaccount
|
||||
|
||||
// 子订阅项目信息
|
||||
Projects []ProviderProject `json:"projects"`
|
||||
|
||||
// 同步时间间隔
|
||||
// example: 3600
|
||||
SyncIntervalSeconds int `json:"sync_interval_seconds"`
|
||||
|
||||
// 同步状态
|
||||
SyncStatus2 string `json:"sync_stauts2"`
|
||||
|
||||
// 云账号环境类型
|
||||
// public: 公有云
|
||||
// private: 私有云
|
||||
// onpremise: 本地IDC
|
||||
// example: public
|
||||
CloudEnv string `json:"cloud_env"`
|
||||
|
||||
// 云账号项目名称
|
||||
// example: system
|
||||
Tenant string `json:"tenant"`
|
||||
|
||||
// 弹性公网Ip数量
|
||||
// example: 2
|
||||
EipCount int `json:"eip_count,allowempty"`
|
||||
|
||||
// 虚拟私有网络数量
|
||||
// example: 4
|
||||
VpcCount int `json:"vpc_count,allowempty"`
|
||||
|
||||
// 云盘数量
|
||||
// example: 12
|
||||
DiskCount int `json:"disk_count,allowempty"`
|
||||
|
||||
// 宿主机数量(不计算虚拟机宿主机数量)
|
||||
// example: 0
|
||||
HostCount int `json:"host_count,allowempty"`
|
||||
|
||||
// 云主机数量
|
||||
// example: 4
|
||||
GuestCount int `json:"guest_count,allowempty"`
|
||||
|
||||
// 块存储数量
|
||||
// example: 12
|
||||
StorageCount int `json:"storage_count,allowempty"`
|
||||
|
||||
// 子订阅数量
|
||||
// example: 1
|
||||
ProviderCount int `json:"provider_count,allowempty"`
|
||||
|
||||
// 路由表数量
|
||||
// example: 0
|
||||
RoutetableCount int `json:"routetable_count,allowempty"`
|
||||
|
||||
// 存储缓存数量
|
||||
// example: 10
|
||||
StoragecacheCount int `json:"storagecache_count,allowempty"`
|
||||
}
|
||||
|
||||
@@ -21,26 +21,120 @@ import (
|
||||
"yunion.io/x/onecloud/pkg/cloudprovider"
|
||||
)
|
||||
|
||||
type CloudproviderDetails struct {
|
||||
Provider string `json:"provider,omitempty"`
|
||||
Brand string `json:"brand,omitempty"`
|
||||
Account string `json:"account,omitempty"`
|
||||
AccountId string `json:"account_id,omitempty"`
|
||||
Manager string `json:"manager,omitempty"`
|
||||
ManagerId string `json:"manager_id,omitempty"`
|
||||
ManagerProject string `json:"manager_project,omitempty"`
|
||||
type CloudproviderInfo struct {
|
||||
// 云平台
|
||||
// example: Google
|
||||
Provider string `json:"provider,omitempty"`
|
||||
|
||||
// 云平台品牌
|
||||
// example: Google
|
||||
Brand string `json:"brand,omitempty"`
|
||||
|
||||
// 云账号名称
|
||||
// example: google-account
|
||||
Account string `json:"account,omitempty"`
|
||||
|
||||
// 云账号Id
|
||||
// example: 4d3c8979-9dd0-439b-8d78-36fe1ab1666c
|
||||
AccountId string `json:"account_id,omitempty"`
|
||||
|
||||
// 子订阅名称
|
||||
// example: google-account
|
||||
Manager string `json:"manager,omitempty"`
|
||||
|
||||
// 子订阅Id
|
||||
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
|
||||
ManagerId string `json:"manager_id,omitempty"`
|
||||
|
||||
// 子订阅所在项目名称
|
||||
// example: system
|
||||
ManagerProject string `json:"manager_project,omitempty"`
|
||||
// 子订阅所在项目Id
|
||||
// example: 4d3c8979-9dd0-439b-8d78-36fe1ab1666c
|
||||
ManagerProjectId string `json:"manager_project_id,omitempty"`
|
||||
ManagerDomain string `json:"manager_domain,omitempty"`
|
||||
ManagerDomainId string `json:"manager_domain_id,omitempty"`
|
||||
Region string `json:"region,omitempty"`
|
||||
RegionId string `json:"region_id,omitempty"`
|
||||
CloudregionId string `json:"cloudregion_id,omitempty"`
|
||||
|
||||
// 子订阅所在域名称
|
||||
// example: Default
|
||||
ManagerDomain string `json:"manager_domain,omitempty"`
|
||||
|
||||
// 子订阅所在域Id
|
||||
// example: default
|
||||
ManagerDomainId string `json:"manager_domain_id,omitempty"`
|
||||
|
||||
// 区域名称
|
||||
// example: 腾讯云 华南地区(广州)
|
||||
Region string `json:"region,omitempty"`
|
||||
// 区域Id
|
||||
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
|
||||
RegionId string `json:"region_id,omitempty"`
|
||||
// 区域Id
|
||||
// example: 6151c89b-77f2-4d43-8ef9-cd03d604a16b
|
||||
CloudregionId string `json:"cloudregion_id,omitempty"`
|
||||
// 区域外部Id
|
||||
// Qcloud/ap-guangzhou
|
||||
RegionExternalId string `json:"region_external_id,omitempty"`
|
||||
RegionExtId string `json:"region_ext_id,omitempty"`
|
||||
Zone string `json:"zone,omitempty"`
|
||||
ZoneId string `json:"zone_id,omitempty"`
|
||||
ZoneExtId string `json:"zone_ext_id,omitempty"`
|
||||
CloudEnv string `json:"cloud_env,omitempty"`
|
||||
// 区域外部Id(不携带平台信息)
|
||||
// example: ap-guangzhou
|
||||
RegionExtId string `json:"region_ext_id,omitempty"`
|
||||
|
||||
// 可用区名称
|
||||
// example: 腾讯云 广州四区
|
||||
Zone string `json:"zone,omitempty"`
|
||||
// 可用区Id
|
||||
// example: 336ac6d2-b80d-43bb-86d5-1ebf474da8d4
|
||||
ZoneId string `json:"zone_id,omitempty"`
|
||||
// 可用区外部Id
|
||||
// example: ap-guangzhou-4
|
||||
ZoneExtId string `json:"zone_ext_id,omitempty"`
|
||||
|
||||
// 云环境
|
||||
// example: public
|
||||
CloudEnv string `json:"cloud_env,omitempty"`
|
||||
}
|
||||
|
||||
type CloudproviderDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SCloudprovider
|
||||
|
||||
// 云账号名称
|
||||
// example: google-account
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
// 子订阅同步状态
|
||||
SyncStatus2 string `json:"sync_status2"`
|
||||
// 支持服务列表
|
||||
Capabilities []string `json:"capabilities"`
|
||||
|
||||
// 云主机数量
|
||||
// example: 1
|
||||
GuestCount int `json:"guest_count"`
|
||||
// 宿主机数量
|
||||
// example: 2
|
||||
HostCount int `json:"host_count"`
|
||||
// 虚拟私有网络数量
|
||||
// example: 4
|
||||
VpcCount int `json:"vpc_count"`
|
||||
// 块存储梳理
|
||||
// example: 4
|
||||
StorageCount int `json:"storage_count"`
|
||||
// 存储缓存数量
|
||||
// example: 1
|
||||
StorageCacheCount int `json:"storagecache_count"`
|
||||
// 弹性公网IP数量
|
||||
// example: 12
|
||||
EipCount int `json:"eip_count"`
|
||||
// 快照数量
|
||||
// example: 0
|
||||
SnapshotCount int `json:"snapshot_count"`
|
||||
// 负载均衡器数量
|
||||
// example: 2
|
||||
LoadbalancerCount int `json:"loadbalancer_count"`
|
||||
// 项目数量
|
||||
ProjectCount int `json:"project_count"`
|
||||
// 同步区域数量
|
||||
SyncRegionCount int `json:"sync_region_count"`
|
||||
|
||||
// 子订阅品牌信息
|
||||
Brand string `json:"brand"`
|
||||
}
|
||||
|
||||
type ManagedResourceListInput struct {
|
||||
|
||||
41
pkg/apis/compute/cloudproviderregion.go
Normal file
41
pkg/apis/compute/cloudproviderregion.go
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CloudproviderregionDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
|
||||
Cloudprovider string
|
||||
Cloudregion string
|
||||
|
||||
// 云账号Id
|
||||
// example: fa4aaf88-aed8-422d-84e7-56dea533b364
|
||||
CloudaccountId string `json:"cloudaccount_id"`
|
||||
// 云账号名称
|
||||
// example: googl-account
|
||||
Cloudaccount string `json:"cloudaccount"`
|
||||
|
||||
// 云账号所在域Id
|
||||
// example: 0df40413-eb69-49c7-895e-618ddeb80f55
|
||||
CloudaccountDomainId string `json:"cloudaccount_domain_id"`
|
||||
// 是否开启自动同步
|
||||
// example: false
|
||||
EnableAutoSync bool `json:"enable_auto_sync"`
|
||||
// 自动同步周期
|
||||
// example: 300
|
||||
SyncIntervalSeconds int `json:"sync_interval_seconds"`
|
||||
}
|
||||
56
pkg/apis/compute/cloudregion.go
Normal file
56
pkg/apis/compute/cloudregion.go
Normal file
@@ -0,0 +1,56 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type CloudregionDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SCloudregion
|
||||
|
||||
// 虚拟私有网络数量
|
||||
// example: 2
|
||||
VpcCount int `json:"vpc_count,allowempty"`
|
||||
// 可用区数量
|
||||
// example: 3
|
||||
ZoneCount int `json:"zone_count,allowempty"`
|
||||
// 云主机梳理
|
||||
// example: 2
|
||||
GuestCount int `json:"guest_count,allowempty"`
|
||||
// IP子网数量
|
||||
// example: 12
|
||||
NetworkCount int `json:"network_count,allowempty"`
|
||||
// 距离前天0点新增云主机数量
|
||||
// example: 0
|
||||
GuestIncrementCount int `json:"guest_increment_count,allowempty"`
|
||||
}
|
||||
|
||||
type CloudregionInfo struct {
|
||||
// 区域的名称
|
||||
// example: Default
|
||||
Region string `json:"region"`
|
||||
|
||||
// 区域的Id
|
||||
// example: default
|
||||
RegionId string `json:"region_id"`
|
||||
|
||||
// 纳管云区域的组合Id(平台+Id)
|
||||
// example: ZStack/59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
|
||||
RegionExternalId string `json:"region_external_id"`
|
||||
|
||||
// 纳管云区域的Id
|
||||
// example: 59e7bc87-a6b3-4c39-8f02-c68e8243d4e4
|
||||
RegionExtId string `json:"region_ext_id"`
|
||||
}
|
||||
@@ -36,6 +36,7 @@ const (
|
||||
CITY_TAIPEI = "Taipei" //台北市
|
||||
CITY_KAOHSIUNG = "Kaohsiung" //高雄市
|
||||
CITY_CHENG_DU = "Chengdu" //成都
|
||||
CITY_HE_YUAN = "HeYuan" //河源
|
||||
CITY_CHONG_QING = "Chongqing" //重庆
|
||||
CITY_LAN_ZHOU = "Lanzhou" //兰州
|
||||
CITY_TAI_YUAN = "Taiyuan" //太原
|
||||
@@ -76,6 +77,11 @@ const (
|
||||
|
||||
//瑞士
|
||||
CITY_ZURICH = "Zurich" //苏黎世
|
||||
CITY_GENEVA = "Geneva" //日内瓦
|
||||
|
||||
// 挪威
|
||||
CITY_STAVANGER = "Stavanger" //斯塔万格
|
||||
CITY_OSLO = "Oslo" // 奥斯陆
|
||||
|
||||
// 马来西亚
|
||||
CITY_KUALA_LUMPUR = "Kuala Lumpur" //吉隆坡
|
||||
@@ -104,6 +110,7 @@ const (
|
||||
CITY_IOWA = "Iowa" //爱荷华
|
||||
CITY_US_GOV_WEST = "us-gov-west" //???
|
||||
CITY_SOUTH_CAROLINA = "South Carolina" //南卡罗来纳州
|
||||
CITY_SALT_LAKE_CITY = "Salt Lake City" //盐湖城
|
||||
|
||||
// 英国
|
||||
CITY_LONDON = "London" //伦敦
|
||||
@@ -114,7 +121,8 @@ const (
|
||||
CITY_DUBAI = "Dubai" //迪拜
|
||||
|
||||
// 德国
|
||||
CITY_FRANKFURT = "Frankfurt" //法兰克福
|
||||
CITY_FRANKFURT = "Frankfurt" // 法兰克福
|
||||
CITY_DELMENHORST = "Delmenhorst" // 代尔门霍斯特
|
||||
|
||||
// 韩国
|
||||
CITY_SEOUL = "Seoul" //首尔
|
||||
@@ -185,4 +193,5 @@ const (
|
||||
COUNTRY_CODE_NG = "NG" //尼日利亚
|
||||
COUNTRY_CODE_VN = "VN" //越南
|
||||
COUNTRY_CODE_CH = "CH" //瑞士
|
||||
COUNTRY_CODE_NO = "NO" //挪威
|
||||
)
|
||||
|
||||
@@ -214,3 +214,24 @@ type DbinstanceFilterListInput struct {
|
||||
// filter by dbinstance_id
|
||||
DbinstanceId string `json:"dbinstance_id" deprecated-by:"dbinstance"`
|
||||
}
|
||||
|
||||
type DBInstanceDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SDBInstance
|
||||
|
||||
CloudproviderInfo
|
||||
// 虚拟私有网络名称
|
||||
// example: test-vpc
|
||||
Vpc string `json:"vpc"`
|
||||
// 安全组名称
|
||||
// example: Default
|
||||
Secgroup string `json:"secgroup"`
|
||||
// iops
|
||||
// example: 0
|
||||
Iops int `json:"iops"`
|
||||
// IP子网名称
|
||||
// example: test-network
|
||||
Network string `json:"network"`
|
||||
// 标签信息
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
}
|
||||
|
||||
@@ -67,3 +67,22 @@ type DBInstanceAccountCreateInput struct {
|
||||
type SDBInstanceSetPrivilegesInput struct {
|
||||
Privileges []SDBInstanceAccountPrivilege `json:"privileges"`
|
||||
}
|
||||
|
||||
type DBInstancePrivilege struct {
|
||||
// 数据库名称
|
||||
Database string
|
||||
// 账号名称
|
||||
Account string
|
||||
// 数据库Id
|
||||
DBInstancedatabaseId string
|
||||
// 权限
|
||||
Privileges string
|
||||
}
|
||||
|
||||
type DBInstanceAccountDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SDBInstanceAccount
|
||||
|
||||
// 账号权限列表
|
||||
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges,allowempty"`
|
||||
}
|
||||
|
||||
@@ -42,3 +42,13 @@ type DBInstanceBackupCreateInput struct {
|
||||
// swagger:ignore
|
||||
ManagerId string
|
||||
}
|
||||
|
||||
type DBInstanceBackupDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SDBInstanceBackup
|
||||
|
||||
// RDS实例名称
|
||||
DBInstance string `json:"dbinstance"`
|
||||
|
||||
CloudproviderInfo
|
||||
}
|
||||
|
||||
@@ -60,3 +60,11 @@ type DBInstanceDatabaseCreateInput struct {
|
||||
// required: false
|
||||
Accounts []SDBInstanceDatabasePrivilege `json:"accounts"`
|
||||
}
|
||||
|
||||
type DBInstancedatabaseDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SDBInstanceDatabase
|
||||
|
||||
// 数据库权限
|
||||
DBInstanceprivileges []DBInstancePrivilege `json:"dbinstanceprivileges"`
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
@@ -128,3 +130,51 @@ type DiskFilterListInput struct {
|
||||
// filter by disk_id
|
||||
DiskId string `json:"disk_id" deprecated-by:"disk"`
|
||||
}
|
||||
|
||||
type SimpleGuest struct {
|
||||
Name string `json:"name"`
|
||||
Id string `json:"id"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type SimpleSnapshotPolicy struct {
|
||||
RepeatWeekdays []int `json:"repeat_weekdays"`
|
||||
TimePoints []int `json:"time_points"`
|
||||
}
|
||||
|
||||
type DiskDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SDisk
|
||||
CloudproviderInfo
|
||||
|
||||
// 云平台
|
||||
Provider string `json:"provider"`
|
||||
// 存储名称
|
||||
Storage string `json:"storage"`
|
||||
// 存储类型
|
||||
StorageType string `json:"storage_type"`
|
||||
// 介质类型
|
||||
MediumType string `json:"medium_type"`
|
||||
|
||||
// 所挂载的虚拟机
|
||||
Guests []SimpleGuest `json:"guests"`
|
||||
// 所挂载的虚拟机
|
||||
Guest string `json:"guest"`
|
||||
// 所挂载虚拟机的数量
|
||||
GuestCount int `json:"guest_count"`
|
||||
// 所挂载虚拟机状态
|
||||
GuestStatus string `json:"guest_status"`
|
||||
|
||||
// 自动清理时间
|
||||
AutoDeleteAt time.Time `json:"auto_delete_at"`
|
||||
// 自动快照策略状态
|
||||
SnapshotpolicyStatus string `json:"snapshotpolicy_status,allowempty"`
|
||||
|
||||
// 自动快照策略
|
||||
Snapshotpolicies []SimpleSnapshotPolicy `json:"snapshotpolicies"`
|
||||
|
||||
// 手动快照数量
|
||||
ManualSnapshotCount int `json:"manual_snapshot_count"`
|
||||
// 最多可创建手动快照数量
|
||||
MaxManualSnapshotCount int `json:"max_manual_snapshot_count"`
|
||||
}
|
||||
|
||||
25
pkg/apis/compute/dynamicschedtag.go
Normal file
25
pkg/apis/compute/dynamicschedtag.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type DynamicschedtagDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SDynamicschedtag
|
||||
|
||||
Schedtag string `json:"schedtag"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
}
|
||||
@@ -12,22 +12,19 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package apis
|
||||
package compute
|
||||
|
||||
type VirtualResourceDetails struct {
|
||||
ModelBaseDetails
|
||||
}
|
||||
|
||||
type VirtualResourceListInput struct {
|
||||
StatusStandaloneResourceListInput
|
||||
|
||||
ProjectizedResourceListInput
|
||||
|
||||
// 列表中包含标记为"系统资源"的资源
|
||||
System *bool `json:"system"`
|
||||
// 是否显示回收站内的资源,默认不显示(对实现了回收站的资源有效,例如主机,磁盘,镜像)
|
||||
PendingDelete *bool `json:"pending_delete"`
|
||||
// 是否显示所有资源,包括回收站和不再回收站的资源
|
||||
// TODO: fix this???
|
||||
PendingDeleteAll *bool `json:"-"`
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type ElasticcacheDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
|
||||
SElasticcache
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
// 虚拟私有网络名称
|
||||
Vpc string `json:"vpc"`
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
}
|
||||
29
pkg/apis/compute/elasticcachebackup.go
Normal file
29
pkg/apis/compute/elasticcachebackup.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type ElasticcacheBackupDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SElasticcacheBackup
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
// 引擎
|
||||
Engine string `json:"engine"`
|
||||
// 引擎版本
|
||||
EngineVersion string `json:"engine_version"`
|
||||
}
|
||||
22
pkg/apis/compute/elasticcachesku.go
Normal file
22
pkg/apis/compute/elasticcachesku.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type ElasticcacheSkuDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SElasticcacheSku
|
||||
}
|
||||
@@ -67,3 +67,13 @@ type SElasticipCreateInput struct {
|
||||
// swagger:ignore
|
||||
NetworkId string
|
||||
}
|
||||
|
||||
type ElasticipDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SElasticip
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
// 绑定资源名称
|
||||
AssociateName string `json:"associate_name"`
|
||||
}
|
||||
|
||||
26
pkg/apis/compute/externalproject.go
Normal file
26
pkg/apis/compute/externalproject.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type ExternalProjectDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
|
||||
SExternalProject
|
||||
CloudproviderInfo
|
||||
|
||||
Tenant string `json:"tenant"`
|
||||
}
|
||||
@@ -21,3 +21,8 @@ import (
|
||||
type GlobalVpcCreateInput struct {
|
||||
apis.EnabledStatusStandaloneResourceCreateInput
|
||||
}
|
||||
|
||||
type GlobalVpcDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SGlobalVpc
|
||||
}
|
||||
|
||||
29
pkg/apis/compute/groupguest.go
Normal file
29
pkg/apis/compute/groupguest.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type GroupguestDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
|
||||
Instancegroup string
|
||||
Server string
|
||||
Guest string
|
||||
|
||||
SGroupguest
|
||||
}
|
||||
29
pkg/apis/compute/groupnetwork.go
Normal file
29
pkg/apis/compute/groupnetwork.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type GroupnetworkDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
SGroupnetwork
|
||||
|
||||
// 主机组名称
|
||||
Instancegroup string
|
||||
// IP子网名称
|
||||
Network string
|
||||
}
|
||||
@@ -229,9 +229,10 @@ var HOSTTYPE_HYPERVISOR = map[string]string{
|
||||
}
|
||||
|
||||
const (
|
||||
VM_AWS_DEFAULT_LOGIN_USER = "ec2user"
|
||||
VM_AZURE_DEFAULT_LOGIN_USER = "toor"
|
||||
VM_ZSTACK_DEFAULT_LOGIN_USER = "root"
|
||||
VM_AWS_DEFAULT_LOGIN_USER = "ec2user"
|
||||
VM_AWS_DEFAULT_WINDOWS_LOGIN_USER = "Administrator"
|
||||
VM_AZURE_DEFAULT_LOGIN_USER = "toor"
|
||||
VM_ZSTACK_DEFAULT_LOGIN_USER = "root"
|
||||
|
||||
VM_METADATA_APP_TAGS = "app_tags"
|
||||
VM_METADATA_CREATE_PARAMS = "create_params"
|
||||
|
||||
45
pkg/apis/compute/guest_disk.go
Normal file
45
pkg/apis/compute/guest_disk.go
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type GuestDiskDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
SGuestdisk
|
||||
|
||||
// 云主机名称
|
||||
Guest string
|
||||
// 云主机名称
|
||||
Server string
|
||||
// 磁盘名称
|
||||
Disk string
|
||||
|
||||
// 存储类型
|
||||
// example: local
|
||||
StorageType string `json:"storage_type"`
|
||||
// 磁盘大小, 单位Mb
|
||||
// example: 10240
|
||||
DiskSize int `json:"disk_size"`
|
||||
// 磁盘状态
|
||||
// example: ready
|
||||
Status string `json:"status"`
|
||||
// 磁盘类型
|
||||
// example: data
|
||||
DiskType string `json:"disk_type"`
|
||||
// 介质类型
|
||||
// example: ssd
|
||||
MediumType string `json:"medium_type"`
|
||||
}
|
||||
29
pkg/apis/compute/guestnetwork.go
Normal file
29
pkg/apis/compute/guestnetwork.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type GuestnetworkDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
SGuestnetwork
|
||||
|
||||
// 云主机名称
|
||||
Guest string
|
||||
// 云主机名称
|
||||
Server string
|
||||
// IP子网名称
|
||||
Network string
|
||||
}
|
||||
@@ -15,6 +15,10 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
@@ -76,6 +80,8 @@ type ServerListInput struct {
|
||||
ResourceType string `json:"resource_type"`
|
||||
// 返回开启主备机功能的主机
|
||||
GetBackupGuestsOnHost *bool `json:"get_backup_guests_on_host"`
|
||||
// 根据宿主机 SN 过滤
|
||||
HostSn string `json:"host_sn"`
|
||||
}
|
||||
|
||||
func (input *ServerListInput) AfterUnmarshal() {
|
||||
@@ -123,3 +129,51 @@ func (i ServerRebuildRootInput) GetKeypairName() string {
|
||||
type ServerResumeInput struct {
|
||||
apis.Meta
|
||||
}
|
||||
|
||||
type ServerDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SGuest
|
||||
CloudproviderInfo
|
||||
|
||||
// details
|
||||
// 网络概要
|
||||
Networks string `json:"networks"`
|
||||
// 磁盘概要
|
||||
Disks string `json:"disks"`
|
||||
// 磁盘详情
|
||||
DisksInfo *jsonutils.JSONArray `json:"disks_info"`
|
||||
// 虚拟机Ip列表
|
||||
VirtualIps string `json:"virtual_ips"`
|
||||
// 安全组规则
|
||||
SecurityRules string `json:"security_rules"`
|
||||
// 操作系统名称
|
||||
OsName string `json:"os_name"`
|
||||
// 操作系统类型
|
||||
OsType string `json:"os_type"`
|
||||
// 系统管理员可见的安全组规则
|
||||
AdminSecurityRules string `json:"admin_security_rules"`
|
||||
|
||||
// list
|
||||
AttachTime time.Time `attach_time`
|
||||
|
||||
// common
|
||||
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
|
||||
|
||||
// 备机所在宿主机名称
|
||||
BackupHostName string `json:"backup_host_name"`
|
||||
// 北京所在宿主机状态
|
||||
BackupHostStatus string `json:"backup_host_status"`
|
||||
// 宿主机名称
|
||||
Host string `json:"host"`
|
||||
// 宿主机SN
|
||||
HostSN string `json:"host_sn"`
|
||||
CanRecycle bool `json:"can_recycle"`
|
||||
// 自动释放时间
|
||||
AutoDeleteAt time.Time `json:"auto_delete_at"`
|
||||
// 标签
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
// 磁盘数量
|
||||
DiskCount int `json:"disk_count"`
|
||||
// 是否支持ISO启动
|
||||
CdromSupport bool `json:"cdrom_support"`
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ type GuesttemplateCreateInput struct {
|
||||
}
|
||||
|
||||
type GuesttemplateDetails struct {
|
||||
apis.Meta
|
||||
apis.SharableVirtualResourceDetails
|
||||
SGuestTemplate
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
@@ -69,3 +71,56 @@ type HostListInput struct {
|
||||
// filter host that is baremetal
|
||||
Baremetal *bool `json:"baremetal"`
|
||||
}
|
||||
|
||||
type HostDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SHost
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
Schedtags []SchedtagShortDescDetails `json:"schedtags"`
|
||||
|
||||
ServerId string `json:"server_id"`
|
||||
Server string `json:"server"`
|
||||
ServerIps string `json:"server_ips"`
|
||||
// 网卡数量
|
||||
NicCount int `json:"nic_count"`
|
||||
// 网卡详情
|
||||
NicInfo []jsonutils.JSONObject `json:"nic_info"`
|
||||
// CPU超分比
|
||||
CpuCommit int `json:"cpu_commit"`
|
||||
// 内存超分比
|
||||
MemCommit int `json:"mem_commit"`
|
||||
// 云主机数量
|
||||
// example: 10
|
||||
Guests int `json:"guests"`
|
||||
// 非系统云主机数量
|
||||
// example: 0
|
||||
NonsystemGuests int `json:"nonsystem_guests"`
|
||||
// 运行中云主机数量
|
||||
// example: 2
|
||||
RunningGuests int `json:"running_geusts"`
|
||||
// CPU超分率
|
||||
CpuCommitRate float64 `json:"cpu_commit_rate"`
|
||||
// 内存超分率
|
||||
MemCommitRate float64 `json:"mem_commit_rate"`
|
||||
// 存储大小
|
||||
Storage int64 `json:"storage"`
|
||||
// 已使用存储大小
|
||||
StorageUsed int64 `json:"storage_used"`
|
||||
// 浪费存储大小(异常磁盘存储大小)
|
||||
StorageWaste int64 `json:"storage_waste"`
|
||||
// 虚拟存储大小
|
||||
StorageVirtual int64 `json:"storage_virtual"`
|
||||
// 可用存储大小
|
||||
StorageFree int64 `json:"storage_free"`
|
||||
// 存储超分率
|
||||
StorageCommitRate float64 `json:"storage_commit_rate"`
|
||||
Spec *jsonutils.JSONDict `json:"spec"`
|
||||
IsPrepaidRecycle bool `json:"is_prepaid_recycle"`
|
||||
CanPrepare bool `json:"can_prepare"`
|
||||
PrepareFailReason string `json:"prepare_fail_reason"`
|
||||
|
||||
// 标签
|
||||
Metadata map[string]string `json:"metadata"`
|
||||
}
|
||||
|
||||
22
pkg/apis/compute/hostjoin.go
Normal file
22
pkg/apis/compute/hostjoin.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
type HostJointsDetails struct {
|
||||
// 宿主机名称
|
||||
Host string `json:"host"`
|
||||
// 裸金属服务器名称
|
||||
Baremetal string `json:"baremetal"`
|
||||
}
|
||||
28
pkg/apis/compute/hostnetwork.go
Normal file
28
pkg/apis/compute/hostnetwork.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type HostnetworkDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
HostJointsDetails
|
||||
SHostwire
|
||||
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
|
||||
NicType string `json:"nic_type"`
|
||||
}
|
||||
25
pkg/apis/compute/hostschedtag.go
Normal file
25
pkg/apis/compute/hostschedtag.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type HostschedtagDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
HostJointsDetails
|
||||
SHostschedtag
|
||||
|
||||
Schedtag string `json:"string"`
|
||||
}
|
||||
57
pkg/apis/compute/hoststorage.go
Normal file
57
pkg/apis/compute/hoststorage.go
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import (
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apis"
|
||||
)
|
||||
|
||||
type HoststorageDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
HostJointsDetails
|
||||
|
||||
SHoststorage
|
||||
|
||||
// 存储名称
|
||||
Storage string `json:"storage"`
|
||||
// 存储大小
|
||||
Capacity int64 `json:"capacity"`
|
||||
// 存储配置信息
|
||||
StorageConf jsonutils.JSONObject `json:"storage_conf"`
|
||||
// 已使用存储大小
|
||||
UsedCapacity int64 `json:"used_capacity"`
|
||||
// 浪费存储大小(异常磁盘总大小)
|
||||
WasteCapacity int64 `json:"waste_capacity"`
|
||||
// 可用存储大小
|
||||
FreeCapacity int64 `json:"free_capacity"`
|
||||
// 存储类型
|
||||
// example: local
|
||||
StorageType string `json:"storage_type"`
|
||||
// 介质类型
|
||||
// example: ssd
|
||||
MediumType string `json:"medium_type"`
|
||||
// 是否启用
|
||||
Enabled bool `json:"enabled"`
|
||||
// 超售比
|
||||
Cmtbound float32 `json:"cmtbound"`
|
||||
// 镜像缓存路径
|
||||
ImagecachePath string `json:"imagecache_path"`
|
||||
// 存储缓存Id
|
||||
StoragecacheId string `json:"storagecached_id"`
|
||||
|
||||
GuestDiskCount int `json:"guest_disk_count,allowempty"`
|
||||
}
|
||||
29
pkg/apis/compute/hostwire.go
Normal file
29
pkg/apis/compute/hostwire.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type HostwireDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
HostJointsDetails
|
||||
SHostwire
|
||||
|
||||
// 二层网络名称
|
||||
Wire string `json:"wire"`
|
||||
|
||||
// 带宽大小
|
||||
Bandwidth int `json:"bandwidth"`
|
||||
}
|
||||
@@ -28,9 +28,11 @@ type InstanceGroupListInput struct {
|
||||
}
|
||||
|
||||
type InstanceGroupDetail struct {
|
||||
apis.Meta
|
||||
apis.VirtualResourceDetails
|
||||
SGroup
|
||||
GuestCount int64 `json:"guest_count"`
|
||||
|
||||
// 云主机数量
|
||||
GuestCount int `json:"guest_count"`
|
||||
}
|
||||
|
||||
type GroupFilterListInput struct {
|
||||
|
||||
49
pkg/apis/compute/instance_snapshot.go
Normal file
49
pkg/apis/compute/instance_snapshot.go
Normal file
@@ -0,0 +1,49 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type SimpleSnapshot struct {
|
||||
// 快照Id
|
||||
Id string `json:"id"`
|
||||
// 快照名称
|
||||
Name string `json:"name"`
|
||||
// 存储Id
|
||||
StorageId string `json:"storage_id"`
|
||||
// 磁盘类型
|
||||
DiskType string `json:"disk_type"`
|
||||
// 区域Id
|
||||
CloudregionId string `json:"cloudregion_id"`
|
||||
// 快照大小
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
type InstnaceSnapshotDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SInstanceSnapshot
|
||||
|
||||
// 云主机状态
|
||||
GuestStatus string `json:"guest_status"`
|
||||
// 云主机名称
|
||||
Guest string `json:"guest"`
|
||||
|
||||
// 存储类型
|
||||
StorageType string `json:"storage_type"`
|
||||
|
||||
// 快照列表
|
||||
Snapshots []SimpleSnapshot `json:"snapshots"`
|
||||
Properties map[string]string `json:"properties"`
|
||||
}
|
||||
29
pkg/apis/compute/isolated_device.go
Normal file
29
pkg/apis/compute/isolated_device.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type IsolateDeviceDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SIsolatedDevice
|
||||
|
||||
// 宿主机名称
|
||||
Host string `json:"host"`
|
||||
// 云主机名称
|
||||
Guest string `json:"guest"`
|
||||
// 云主机状态
|
||||
GuestStatus string `json:"guest_status"`
|
||||
}
|
||||
@@ -40,3 +40,18 @@ type KeypairCreateInput struct {
|
||||
// default: RSA
|
||||
Scheme string `json:"scheme"`
|
||||
}
|
||||
|
||||
type KeypairDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SKeypair
|
||||
|
||||
// 私钥长度
|
||||
PrivateKeyLen int `json:"private_key_len"`
|
||||
// 关联云主机次数
|
||||
LinkedGuestCount int `json:"linked_guest_count"`
|
||||
|
||||
// 用户Id
|
||||
OwnerId string `json:"owner_id"`
|
||||
// 用户名称
|
||||
OwnerName string `json:"owner_name"`
|
||||
}
|
||||
|
||||
@@ -114,3 +114,20 @@ type LoadbalancerClusterListInput struct {
|
||||
type LoadbalancerAclListInput struct {
|
||||
apis.SharableVirtualResourceListInput
|
||||
}
|
||||
|
||||
type LoadbalancerDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancer
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
// 公网IP地址
|
||||
Eip string `json:"eip"`
|
||||
// 公网IP地址类型: 弹性、非弹性
|
||||
// example: public_ip
|
||||
EipMode string `json:"eip_mode"`
|
||||
// 虚拟私有网络名称
|
||||
Vpc string `json:"vpc"`
|
||||
// 后端服务器组名称
|
||||
BackendGroup string `json:"backend_group"`
|
||||
}
|
||||
|
||||
22
pkg/apis/compute/loadbalanceracl.go
Normal file
22
pkg/apis/compute/loadbalanceracl.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerAclDetails struct {
|
||||
apis.SharableVirtualResourceDetails
|
||||
SLoadbalancerAcl
|
||||
}
|
||||
25
pkg/apis/compute/loadbalanceragent.go
Normal file
25
pkg/apis/compute/loadbalanceragent.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerAgentDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SLoadbalancerAgent
|
||||
|
||||
ZoneInfo ZoneInfo
|
||||
Cluster string `json:"cluster"`
|
||||
}
|
||||
26
pkg/apis/compute/loadbalancerbackend.go
Normal file
26
pkg/apis/compute/loadbalancerbackend.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerBackendDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancerBackend
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
VpcId string `json:"vpc_id"`
|
||||
}
|
||||
25
pkg/apis/compute/loadbalancerbackendgroup.go
Normal file
25
pkg/apis/compute/loadbalancerbackendgroup.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerBackendGroupDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancerBackendGroup
|
||||
|
||||
Loadbalancer string `json:"loadbalancer"`
|
||||
CloudregionInfo
|
||||
}
|
||||
22
pkg/apis/compute/loadbalancercertificate.go
Normal file
22
pkg/apis/compute/loadbalancercertificate.go
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerCertificateDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancerCertificate
|
||||
}
|
||||
24
pkg/apis/compute/loadbalancercluster.go
Normal file
24
pkg/apis/compute/loadbalancercluster.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerCusterDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SLoadbalancerCluster
|
||||
|
||||
ZoneInfo
|
||||
}
|
||||
30
pkg/apis/compute/loadbalancerlistener.go
Normal file
30
pkg/apis/compute/loadbalancerlistener.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerListenerDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancerListener
|
||||
|
||||
BackendGroup string `json:"backend_group"`
|
||||
Loadbalancer string `json:"loadbalancer"`
|
||||
AclName string `json:"acl_name"`
|
||||
CertificateName string `json:"certificate_name"`
|
||||
OriginCertificateId string `json:"origin_certificate_id"`
|
||||
|
||||
CloudregionInfo
|
||||
}
|
||||
26
pkg/apis/compute/loadbalancerlistenerrule.go
Normal file
26
pkg/apis/compute/loadbalancerlistenerrule.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancerListenerRuleDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SLoadbalancerListenerRule
|
||||
|
||||
BackendGroup string `json:"backend_group"`
|
||||
|
||||
CloudregionInfo
|
||||
}
|
||||
27
pkg/apis/compute/loadbalancernetwork.go
Normal file
27
pkg/apis/compute/loadbalancernetwork.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type LoadbalancernetworkDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
SLoadbalancerNetwork
|
||||
|
||||
// 负载均衡器名称
|
||||
Loadbalancer string `json:"loadbalancer"`
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
}
|
||||
@@ -39,3 +39,40 @@ type SNatDCreateInput struct {
|
||||
ExternalPort int
|
||||
IpProtocol string
|
||||
}
|
||||
|
||||
type NatDEntryDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
// SNatDEntry
|
||||
|
||||
Natgateway string `json:"natgateway"`
|
||||
RealName string `json:"real_name"`
|
||||
}
|
||||
|
||||
type NatSEntryDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
// SNatSEntry
|
||||
|
||||
Natgateway string `json:"natgateway"`
|
||||
// RealName identifies the local name of SNAT record
|
||||
RealName string `json:"real_name"`
|
||||
Network SimpleNetwork `json:"network"`
|
||||
}
|
||||
|
||||
type SimpleNetwork struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
GuestIpStart string `json:"guest_ip_start"`
|
||||
GuestIpEnd string `json:"guest_ip_end"`
|
||||
GuestIp6Start string `json:"guest_ip6_start"`
|
||||
GuestIp6End string `json:"guest_ip6_end"`
|
||||
}
|
||||
|
||||
type NatgatewayDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SNatGateway
|
||||
|
||||
CloudproviderInfo
|
||||
Vpc string `json:"vpc"`
|
||||
|
||||
NatSpec string `json:"nat_spec"`
|
||||
}
|
||||
|
||||
@@ -59,6 +59,10 @@ type NetworkListInput struct {
|
||||
UsableResourceListInput
|
||||
|
||||
WireFilterListInput
|
||||
|
||||
// description: search ip address in network.
|
||||
// example: 10.168.222.1
|
||||
Ip string `json:"ip"`
|
||||
}
|
||||
|
||||
type NetworkCreateInput struct {
|
||||
@@ -115,25 +119,38 @@ type NetworkCreateInput struct {
|
||||
}
|
||||
|
||||
type NetworkDetails struct {
|
||||
apis.Meta
|
||||
apis.SharableVirtualResourceDetails
|
||||
|
||||
CloudproviderDetails
|
||||
CloudproviderInfo
|
||||
SNetwork
|
||||
Wire string `json:"wire"`
|
||||
Exit bool `json:"exit"`
|
||||
Ports int `json:"ports"`
|
||||
PortsUsed int `json:"ports_used"`
|
||||
Vnics int `json:"vnics"`
|
||||
BmVnics int `json:"bm_nics"`
|
||||
LbVnics int `json:"lb_vnics"`
|
||||
EipVnics int `json:"eip_vnics"`
|
||||
GroupVnics int `json:"group_vnics"`
|
||||
ReserveVnics int `json:"reserve_vnics"`
|
||||
Vpc string `json:"vpc"`
|
||||
VpcId string `json:"vpc_id"`
|
||||
VpcExtId string `json:"vpc_ext_id"`
|
||||
|
||||
// 二层网络名称
|
||||
Wire string `json:"wire"`
|
||||
// 是否是内网
|
||||
Exit bool `json:"exit"`
|
||||
// 端口数量
|
||||
Ports int `json:"ports"`
|
||||
// 已使用端口数量
|
||||
PortsUsed int `json:"ports_used"`
|
||||
// 网卡数量
|
||||
Vnics int `json:"vnics"`
|
||||
// 裸金属网卡数量
|
||||
BmVnics int `json:"bm_nics"`
|
||||
// 负载均衡网卡数量
|
||||
LbVnics int `json:"lb_vnics"`
|
||||
// 浮动Ip网卡数量
|
||||
EipVnics int `json:"eip_vnics"`
|
||||
GroupVnics int `json:"group_vnics"`
|
||||
// 预留IP数量
|
||||
ReserveVnics int `json:"reserve_vnics"`
|
||||
// 虚拟私有网络名称
|
||||
Vpc string `json:"vpc"`
|
||||
// 虚拟私有网络Id
|
||||
VpcId string `json:"vpc_id"`
|
||||
// 虚拟私有网络外部Id
|
||||
VpcExtId string `json:"vpc_ext_id"`
|
||||
|
||||
// 路由信息
|
||||
Routes [][]string `json:"routes"`
|
||||
Schedtags []SchedtagShortDescDetails `json:"schedtags"`
|
||||
}
|
||||
|
||||
40
pkg/apis/compute/networkinterface.go
Normal file
40
pkg/apis/compute/networkinterface.go
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type NetworkInterfaceNetworkInfo struct {
|
||||
// Ip子网Id
|
||||
NetworkId string `json:"network_id"`
|
||||
// IP地址
|
||||
IpAddr string `json:"ip_addr"`
|
||||
// 是否是主ip地址
|
||||
Primary bool `json:"primary"`
|
||||
// 弹性网卡id
|
||||
NetworkinterfaceId string `json:"networkinterface_id"`
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
}
|
||||
|
||||
type NetworkInterfaceDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SNetworkInterface
|
||||
|
||||
CloudproviderInfo
|
||||
|
||||
// 弹性网卡网络信息
|
||||
Networks []NetworkInterfaceNetworkInfo `json:"networks"`
|
||||
}
|
||||
26
pkg/apis/compute/networkschedtag.go
Normal file
26
pkg/apis/compute/networkschedtag.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type NetworkschedtagDetails struct {
|
||||
apis.JoinModelBaseDetails
|
||||
SNetworkschedtag
|
||||
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
Schedtag string `json:"schedtag"`
|
||||
}
|
||||
@@ -36,3 +36,13 @@ type ReservedipListInput struct {
|
||||
// list all reserved ips, including expired ones
|
||||
All *bool `json:"all"`
|
||||
}
|
||||
|
||||
type ReservedipDetails struct {
|
||||
apis.ModelBaseDetails
|
||||
SReservedip
|
||||
|
||||
// IP子网名称
|
||||
Network string `json:"network"`
|
||||
// 是否过期
|
||||
Expired bool `json:"expired"`
|
||||
}
|
||||
|
||||
28
pkg/apis/compute/routetable.go
Normal file
28
pkg/apis/compute/routetable.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type RouteTableDetails struct {
|
||||
apis.VirtualResourceDetails
|
||||
SRouteTable
|
||||
CloudproviderInfo
|
||||
|
||||
// 虚拟私有网络名称
|
||||
Vpc string `json:"vpc"`
|
||||
// 区域名称
|
||||
Cloudregion string `json:"cloudregion"`
|
||||
}
|
||||
25
pkg/apis/compute/schedpolicy.go
Normal file
25
pkg/apis/compute/schedpolicy.go
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2019 Yunion
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// 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 compute
|
||||
|
||||
import "yunion.io/x/onecloud/pkg/apis"
|
||||
|
||||
type SchedpolicyDetails struct {
|
||||
apis.StandaloneResourceDetails
|
||||
SSchedpolicy
|
||||
|
||||
Schedtag string `json:"schedtag"`
|
||||
ResourceType string `json:"resource_type"`
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user