![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.compute.models.BootDiagnostics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-compute Show documentation
Show all versions of azure-resourcemanager-compute Show documentation
This package contains Microsoft Azure Compute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.compute.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.
* You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the
* hypervisor.
*/
@Fluent
public final class BootDiagnostics implements JsonSerializable {
/*
* Whether boot diagnostics should be enabled on the Virtual Machine.
*/
private Boolean enabled;
/*
* Uri of the storage account to use for placing the console output and screenshot. If storageUri is not specified
* while enabling boot diagnostics, managed storage will be used.
*/
private String storageUri;
/**
* Creates an instance of BootDiagnostics class.
*/
public BootDiagnostics() {
}
/**
* Get the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine.
*
* @return the enabled value.
*/
public Boolean enabled() {
return this.enabled;
}
/**
* Set the enabled property: Whether boot diagnostics should be enabled on the Virtual Machine.
*
* @param enabled the enabled value to set.
* @return the BootDiagnostics object itself.
*/
public BootDiagnostics withEnabled(Boolean enabled) {
this.enabled = enabled;
return this;
}
/**
* Get the storageUri property: Uri of the storage account to use for placing the console output and screenshot. If
* storageUri is not specified while enabling boot diagnostics, managed storage will be used.
*
* @return the storageUri value.
*/
public String storageUri() {
return this.storageUri;
}
/**
* Set the storageUri property: Uri of the storage account to use for placing the console output and screenshot. If
* storageUri is not specified while enabling boot diagnostics, managed storage will be used.
*
* @param storageUri the storageUri value to set.
* @return the BootDiagnostics object itself.
*/
public BootDiagnostics withStorageUri(String storageUri) {
this.storageUri = storageUri;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeBooleanField("enabled", this.enabled);
jsonWriter.writeStringField("storageUri", this.storageUri);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of BootDiagnostics from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of BootDiagnostics if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IOException If an error occurs while reading the BootDiagnostics.
*/
public static BootDiagnostics fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
BootDiagnostics deserializedBootDiagnostics = new BootDiagnostics();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("enabled".equals(fieldName)) {
deserializedBootDiagnostics.enabled = reader.getNullable(JsonReader::getBoolean);
} else if ("storageUri".equals(fieldName)) {
deserializedBootDiagnostics.storageUri = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedBootDiagnostics;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy