
com.azure.resourcemanager.storagepool.fluent.models.IscsiTargetInner Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.storagepool.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.storagepool.models.Acl;
import com.azure.resourcemanager.storagepool.models.IscsiLun;
import com.azure.resourcemanager.storagepool.models.IscsiTargetAclMode;
import com.azure.resourcemanager.storagepool.models.OperationalStatus;
import com.azure.resourcemanager.storagepool.models.ProvisioningStates;
import com.azure.resourcemanager.storagepool.models.SystemMetadata;
import java.io.IOException;
import java.util.List;
/**
* Response for iSCSI Target requests.
*/
@Fluent
public final class IscsiTargetInner extends ProxyResource {
/*
* Properties for iSCSI Target operations.
*/
private IscsiTargetProperties innerProperties = new IscsiTargetProperties();
/*
* Resource metadata required by ARM RPC
*/
private SystemMetadata systemData;
/*
* Azure resource id. Indicates if this resource is managed by another Azure resource.
*/
private String managedBy;
/*
* List of Azure resource ids that manage this resource.
*/
private List managedByExtended;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/**
* Creates an instance of IscsiTargetInner class.
*/
public IscsiTargetInner() {
}
/**
* Get the innerProperties property: Properties for iSCSI Target operations.
*
* @return the innerProperties value.
*/
private IscsiTargetProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the systemData property: Resource metadata required by ARM RPC.
*
* @return the systemData value.
*/
public SystemMetadata systemData() {
return this.systemData;
}
/**
* Get the managedBy property: Azure resource id. Indicates if this resource is managed by another Azure resource.
*
* @return the managedBy value.
*/
public String managedBy() {
return this.managedBy;
}
/**
* Get the managedByExtended property: List of Azure resource ids that manage this resource.
*
* @return the managedByExtended value.
*/
public List managedByExtended() {
return this.managedByExtended;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* Get the aclMode property: Mode for Target connectivity.
*
* @return the aclMode value.
*/
public IscsiTargetAclMode aclMode() {
return this.innerProperties() == null ? null : this.innerProperties().aclMode();
}
/**
* Set the aclMode property: Mode for Target connectivity.
*
* @param aclMode the aclMode value to set.
* @return the IscsiTargetInner object itself.
*/
public IscsiTargetInner withAclMode(IscsiTargetAclMode aclMode) {
if (this.innerProperties() == null) {
this.innerProperties = new IscsiTargetProperties();
}
this.innerProperties().withAclMode(aclMode);
return this;
}
/**
* Get the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy.
*
* @return the staticAcls value.
*/
public List staticAcls() {
return this.innerProperties() == null ? null : this.innerProperties().staticAcls();
}
/**
* Set the staticAcls property: Access Control List (ACL) for an iSCSI Target; defines LUN masking policy.
*
* @param staticAcls the staticAcls value to set.
* @return the IscsiTargetInner object itself.
*/
public IscsiTargetInner withStaticAcls(List staticAcls) {
if (this.innerProperties() == null) {
this.innerProperties = new IscsiTargetProperties();
}
this.innerProperties().withStaticAcls(staticAcls);
return this;
}
/**
* Get the luns property: List of LUNs to be exposed through iSCSI Target.
*
* @return the luns value.
*/
public List luns() {
return this.innerProperties() == null ? null : this.innerProperties().luns();
}
/**
* Set the luns property: List of LUNs to be exposed through iSCSI Target.
*
* @param luns the luns value to set.
* @return the IscsiTargetInner object itself.
*/
public IscsiTargetInner withLuns(List luns) {
if (this.innerProperties() == null) {
this.innerProperties = new IscsiTargetProperties();
}
this.innerProperties().withLuns(luns);
return this;
}
/**
* Get the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server".
*
* @return the targetIqn value.
*/
public String targetIqn() {
return this.innerProperties() == null ? null : this.innerProperties().targetIqn();
}
/**
* Set the targetIqn property: iSCSI Target IQN (iSCSI Qualified Name); example: "iqn.2005-03.org.iscsi:server".
*
* @param targetIqn the targetIqn value to set.
* @return the IscsiTargetInner object itself.
*/
public IscsiTargetInner withTargetIqn(String targetIqn) {
if (this.innerProperties() == null) {
this.innerProperties = new IscsiTargetProperties();
}
this.innerProperties().withTargetIqn(targetIqn);
return this;
}
/**
* Get the provisioningState property: State of the operation on the resource.
*
* @return the provisioningState value.
*/
public ProvisioningStates provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
/**
* Get the status property: Operational status of the iSCSI Target.
*
* @return the status value.
*/
public OperationalStatus status() {
return this.innerProperties() == null ? null : this.innerProperties().status();
}
/**
* Set the status property: Operational status of the iSCSI Target.
*
* @param status the status value to set.
* @return the IscsiTargetInner object itself.
*/
public IscsiTargetInner withStatus(OperationalStatus status) {
if (this.innerProperties() == null) {
this.innerProperties = new IscsiTargetProperties();
}
this.innerProperties().withStatus(status);
return this;
}
/**
* Get the endpoints property: List of private IPv4 addresses to connect to the iSCSI Target.
*
* @return the endpoints value.
*/
public List endpoints() {
return this.innerProperties() == null ? null : this.innerProperties().endpoints();
}
/**
* Set the endpoints property: List of private IPv4 addresses to connect to the iSCSI Target.
*
* @param endpoints the endpoints value to set.
* @return the IscsiTargetInner object itself.
*/
public IscsiTargetInner withEndpoints(List endpoints) {
if (this.innerProperties() == null) {
this.innerProperties = new IscsiTargetProperties();
}
this.innerProperties().withEndpoints(endpoints);
return this;
}
/**
* Get the port property: The port used by iSCSI Target portal group.
*
* @return the port value.
*/
public Integer port() {
return this.innerProperties() == null ? null : this.innerProperties().port();
}
/**
* Set the port property: The port used by iSCSI Target portal group.
*
* @param port the port value to set.
* @return the IscsiTargetInner object itself.
*/
public IscsiTargetInner withPort(Integer port) {
if (this.innerProperties() == null) {
this.innerProperties = new IscsiTargetProperties();
}
this.innerProperties().withPort(port);
return this;
}
/**
* Get the sessions property: List of identifiers for active sessions on the iSCSI target.
*
* @return the sessions value.
*/
public List sessions() {
return this.innerProperties() == null ? null : this.innerProperties().sessions();
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property innerProperties in model IscsiTargetInner"));
} else {
innerProperties().validate();
}
if (systemData() != null) {
systemData().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(IscsiTargetInner.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of IscsiTargetInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of IscsiTargetInner if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the IscsiTargetInner.
*/
public static IscsiTargetInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
IscsiTargetInner deserializedIscsiTargetInner = new IscsiTargetInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedIscsiTargetInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedIscsiTargetInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedIscsiTargetInner.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedIscsiTargetInner.innerProperties = IscsiTargetProperties.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
deserializedIscsiTargetInner.systemData = SystemMetadata.fromJson(reader);
} else if ("managedBy".equals(fieldName)) {
deserializedIscsiTargetInner.managedBy = reader.getString();
} else if ("managedByExtended".equals(fieldName)) {
List managedByExtended = reader.readArray(reader1 -> reader1.getString());
deserializedIscsiTargetInner.managedByExtended = managedByExtended;
} else {
reader.skipChildren();
}
}
return deserializedIscsiTargetInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy