Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持filesystem disk #845

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public static class Record {

private List<Container> containers;

private List<Filesystem> filesystem;

private List<Disk> disk;

private CPU cPU;

private Memory memory;
Expand All @@ -84,6 +88,23 @@ public void setContainers(List<Container> containers) {
this.containers = containers;
}

public List<Filesystem> getFilesystem() {
return filesystem;
}

public void setFilesystem(List<Filesystem> filesystem) {
this.filesystem = filesystem;
}

public List<Disk> getDisk() {
return this.disk;
}

public void setDisk(List<Disk> disk) {
this.disk = disk;
}


public CPU getCPU() {
return this.cPU;
}
Expand Down Expand Up @@ -237,6 +258,112 @@ public void setRss(Long rss) {
}
}

public static class Filesystem {

private Long capacity;

private Long available;

private String fsName;

private String category;

private Long usage;

public Long getCapacity() {
return this.capacity;
}

public void setCapacity(Long capacity) {
this.capacity = capacity;
}

public Long getAvailable() {
return this.available;
}

public void setAvailable(Long available) {
this.available = available;
}

public String getFsName() {
return this.fsName;
}

public void setFsName(String fsName) {
this.fsName = fsName;
}

public String getCategory() {
return this.category;
}

public void setCategory(String category) {
this.category = category;
}

public Long getUsage() {
return this.usage;
}

public void setUsage(Long usage) {
this.usage = usage;
}
}

public static class Disk {

private Long writeBytes;

private String device;

private Long writeIo;

private Long readBytes;

private Long readIo;

public Long getWriteBytes() {
return this.writeBytes;
}

public void setWriteBytes(Long writeBytes) {
this.writeBytes = writeBytes;
}

public String getDevice() {
return this.device;
}

public void setDevice(String device) {
this.device = device;
}

public Long getWriteIo() {
return this.writeIo;
}

public void setWriteIo(Long writeIo) {
this.writeIo = writeIo;
}

public Long getReadBytes() {
return this.readBytes;
}

public void setReadBytes(Long readBytes) {
this.readBytes = readBytes;
}

public Long getReadIo() {
return this.readIo;
}

public void setReadIo(Long readIo) {
this.readIo = readIo;
}
}

public static class CPU {

private Long usageNanoCores;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* 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 com.aliyuncs.eci.transform.v20180808;
/*
* 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 com.aliyuncs.eci.transform.v20180808;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -25,13 +25,13 @@
import com.aliyuncs.eci.model.v20180808.DescribeContainerGroupMetricResponse.Record.Container.Memory2;
import com.aliyuncs.eci.model.v20180808.DescribeContainerGroupMetricResponse.Record.Memory;
import com.aliyuncs.eci.model.v20180808.DescribeContainerGroupMetricResponse.Record.Network;
import com.aliyuncs.eci.model.v20180808.DescribeContainerGroupMetricResponse.Record.Network._Interface;
import com.aliyuncs.transform.UnmarshallerContext;


public class DescribeContainerGroupMetricResponseUnmarshaller {

public static DescribeContainerGroupMetricResponse unmarshall(DescribeContainerGroupMetricResponse describeContainerGroupMetricResponse, UnmarshallerContext context) {
import com.aliyuncs.eci.model.v20180808.DescribeContainerGroupMetricResponse.Record.Network._Interface;
import com.aliyuncs.transform.UnmarshallerContext;
public class DescribeContainerGroupMetricResponseUnmarshaller {
public static DescribeContainerGroupMetricResponse unmarshall(DescribeContainerGroupMetricResponse describeContainerGroupMetricResponse, UnmarshallerContext context) {

describeContainerGroupMetricResponse.setRequestId(context.stringValue("DescribeContainerGroupMetricResponse.RequestId"));
describeContainerGroupMetricResponse.setContainerGroupId(context.stringValue("DescribeContainerGroupMetricResponse.ContainerGroupId"));
Expand Down Expand Up @@ -96,10 +96,34 @@ public static DescribeContainerGroupMetricResponse unmarshall(DescribeContainerG
}
record.setContainers(containers);

List<Record.Filesystem> filesystems = new ArrayList<Record.Filesystem>();
for (int j = 0; j < context.lengthValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Filesystem.Length"); j++){
Record.Filesystem filesystem = new Record.Filesystem();
filesystem.setAvailable(context.longValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Filesystem[" + j +"].Available"));
filesystem.setCapacity(context.longValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Filesystem[" + j +"].Capacity"));
filesystem.setUsage(context.longValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Filesystem[" + j +"].Usage"));
filesystem.setFsName(context.stringValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Filesystem[" + j +"].FsName"));
filesystem.setCategory(context.stringValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Filesystem[" + j +"].Category"));
filesystems.add(filesystem);
}
record.setFilesystem(filesystems);

List<Record.Disk> disks = new ArrayList<Record.Disk>();
for (int j = 0; j < context.lengthValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Disk.Length"); j++){
Record.Disk disk = new Record.Disk();
disk.setDevice(context.stringValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Disk[" + j +"].Device"));
disk.setReadBytes(context.longValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Disk[" + j +"].ReadBytes"));
disk.setReadIo(context.longValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Disk[" + j +"].ReadIo"));
disk.setWriteBytes(context.longValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Disk[" + j +"].WriteBytes"));
disk.setWriteIo(context.longValue("DescribeContainerGroupMetricResponse.Records["+ i +"].Disk[" + j +"].WriteIo"));
disks.add(disk);
}
record.setDisk(disks);

records.add(record);
}
describeContainerGroupMetricResponse.setRecords(records);

return describeContainerGroupMetricResponse;
}
describeContainerGroupMetricResponse.setRecords(records);
return describeContainerGroupMetricResponse;
}
}
Loading