{% extends "layout.html" %}

{% block content %}

<ol class="breadcrumb">
    <li><a href="{{ url_for('account_view') }}">Account</a></li>
    <li><a href="{{ url_for('subscription_view', subscription_id=subscription_id) }}">{{subscription_id}}</a></li>
    <li><a href="{{ url_for('resourcegroup_view', subscription_id=subscription_id, resource_group_name=resource_group_name) }}">{{resource_group_name}}</a></li>
    <li class="active">{{model.account_props.name}}</li>
</ol>

<h3>Account Properties</h3>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th>Name</th>
            <th>Value</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Resource Group</td>
            <td><a href="{{ url_for('resourcegroup_view', subscription_id=subscription_id, resource_group_name=resource_group_name) }}">{{resource_group_name}}</a></td>
        </tr>
        <tr>
            <td>Account Name</td>
            <td>{{model.account_props.name}}</td>
        </tr>
        <tr>
            <td>Account Type</td>
            <td>{{model.account_props.account_type}}</td>
        </tr>
        <tr>
            <td>Provisioning State</td>
            <td>{{model.account_props.provisioning_state}}</td>
        </tr>
        <tr>
            <td>Primary Location</td>
            <td>{{model.account_props.primary_location}}</td>
        </tr>
        <tr>
            <td>Primary Location Status</td>
            <td>{{model.account_props._status_of_primary}}</td>
        </tr>
        <tr>
            <td>Secondary Location</td>
            <td>{{model.account_props.secondary_location}}</td>
        </tr>
        <tr>
            <td>Secondary Location Status</td>
            <td>{{model.account_props._status_of_secondary}}</td>
        </tr>
    </tbody>
</table>

<h3>Account Keys</h3>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th>Name</th>
            <th>Value</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Primary Key</td>
            <td>{{model.account_keys.key1}}</td>
        </tr>
        <tr>
            <td>Secondary Key</td>
            <td>{{model.account_keys.key2}}</td>
        </tr>
    </tbody>
</table>

<h3>Code Snippets</h3>
<div>

    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#snippet-blob" aria-controls="snippet-blob" role="tab" data-toggle="tab">Blob</a></li>
        <li role="presentation"><a href="#snippet-file" aria-controls="snippet-file" role="tab" data-toggle="tab">File</a></li>
        <li role="presentation"><a href="#snippet-table" aria-controls="snippet-table" role="tab" data-toggle="tab">Table</a></li>
        <li role="presentation"><a href="#snippet-queue" aria-controls="snippet-queue" role="tab" data-toggle="tab">Queue</a></li>
    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="snippet-blob">
            <pre>
from azure.storage.blob import BlobService
service = BlobService(
    account_name="{{model.account_props.name}}",
    account_key="{{model.account_keys.key1}}",
)
</pre>

        </div>
        <div role="tabpanel" class="tab-pane" id="snippet-file">
            <pre>
from azure.storage.file import FileService
service = FileService(
    account_name="{{model.account_props.name}}",
    account_key="{{model.account_keys.key1}}",
)
</pre>

        </div>
        <div role="tabpanel" class="tab-pane" id="snippet-table">
            <pre>
from azure.storage.table import TableService
service = TableService(
    account_name="{{model.account_props.name}}",
    account_key="{{model.account_keys.key1}}",
)
</pre>

        </div>
        <div role="tabpanel" class="tab-pane" id="snippet-queue">
            <pre>
from azure.storage.queue import QueueService
service = QueueService(
    account_name="{{model.account_props.name}}",
    account_key="{{model.account_keys.key1}}",
)
</pre>

        </div>
    </div>

</div>

<h3>Logging</h3>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th>Service</th>
            <th>Read</th>
            <th>Write</th>
            <th>Delete</th>
            <th>Retention Policy</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Blob Service</td>
            <td>{{model.blob_service_properties.logging.read}}</td>
            <td>{{model.blob_service_properties.logging.write}}</td>
            <td>{{model.blob_service_properties.logging.write}}</td>
            <td>{{model.blob_service_properties.logging.retention_policy.enabled}}</td>
        </tr>
        <tr>
            <td>Table Service</td>
            <td>{{model.table_service_properties.logging.read}}</td>
            <td>{{model.table_service_properties.logging.write}}</td>
            <td>{{model.table_service_properties.logging.write}}</td>
            <td>{{model.table_service_properties.logging.retention_policy.enabled}}</td>
        </tr>
        <tr>
            <td>Queue Service</td>
            <td>{{model.queue_service_properties.logging.read}}</td>
            <td>{{model.queue_service_properties.logging.write}}</td>
            <td>{{model.queue_service_properties.logging.write}}</td>
            <td>{{model.queue_service_properties.logging.retention_policy.enabled}}</td>
        </tr>
    </tbody>
</table>

<h3>Resources</h3>
<table class="table table-striped table-condensed">
    <thead>
        <tr>
            <th>Service</th>
            <th>Resource Type</th>
            <th>Name</th>
        </tr>
    </thead>
    <tbody>
        {% for container in model.blob_containers %}
        <tr>
            <td>Blob Service</td>
            <td>Container</td>
            <td><a href="{{ url_for('storageaccount_container_view', subscription_id=subscription_id, resource_group_name=resource_group_name, account_name=model.account_props.name, container_name=container.name) }}">{{container.name}}</a></td>
        </tr>
        {% endfor %}
        {% for share in model.shares %}
        <tr>
            <td>File Service</td>
            <td>Share</td>
            <td>{{share.name}}</td>
        </tr>
        {% endfor %}
        {% for table in model.tables %}
        <tr>
            <td>Table Service</td>
            <td>Table</td>
            <td><a href="{{ url_for('storageaccount_table_view', subscription_id=subscription_id, resource_group_name=resource_group_name, account_name=model.account_props.name, table_name=table.name) }}">{{table.name}}</a></td>
        </tr>
        {% endfor %}
        {% for queue in model.queues %}
        <tr>
            <td>Queue Service</td>
            <td>Queue</td>
            <td><a href="{{ url_for('storageaccount_queue_view', subscription_id=subscription_id, resource_group_name=resource_group_name, account_name=model.account_props.name, queue_name=queue.name) }}">{{queue.name}}</a></td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}
