jkawamoto/roadie

View on GitHub
cloud/azure/batch/models/network_configuration.go

Summary

Maintainability
A
50 mins
Test Coverage
package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
    strfmt "github.com/go-openapi/strfmt"

    "github.com/go-openapi/errors"
)

// NetworkConfiguration The network configuration for a pool.
// swagger:model NetworkConfiguration
type NetworkConfiguration struct {

    // The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.
    //
    // The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes, and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. This property can only be specified for pools created with a cloudServiceConfiguration.
    SubnetID string `json:"subnetId,omitempty"`
}

// Validate validates this network configuration
func (m *NetworkConfiguration) Validate(formats strfmt.Registry) error {
    var res []error

    if len(res) > 0 {
        return errors.CompositeValidationError(res...)
    }
    return nil
}