This file is indexed.

/usr/share/php/php-opencloud/OpenCloud/Compute/Network.php is in php-opencloud 1.6.0+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
/**
 * PHP OpenCloud library.
 * 
 * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information.
 * @license   https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
 * @version   1.6.0
 * @author    Glen Campbell <glen.campbell@rackspace.com>
 * @author    Jamie Hannaford <jamie.hannaford@rackspace.com>
 */

namespace OpenCloud\Compute;

use OpenCloud\Common\PersistentObject;
use OpenCloud\Common\Lang;
use OpenCloud\Common\Exceptions;

/**
 * The Network class represents a single virtual network
 */
class Network extends PersistentObject 
{

    public $id;
    public $label;
    public $cidr;
    
    protected static $json_name = 'network';
    protected static $url_resource = 'os-networksv2';

    /**
     * Creates a new isolated Network object
     *
     * NOTE: contains hacks to recognize the Rackspace public and private
     * networks. These are not really networks, but they show up in lists.
     *
     * @param \OpenCloud\Compute $service The compute service associated with
     *      the network
     * @param string $id The ID of the network (this handles the pseudo-networks
     *      RAX_PUBLIC and RAX_PRIVATE
     * @return void
     */
    public function __construct(Service $service, $id = null) 
    {
        $this->id = $id;

        switch ($id) {
            case RAX_PUBLIC:
                $this->label = 'public';
                $this->cidr = 'NA';
                break;
            case RAX_PRIVATE:
                $this->label = 'private';
                $this->cidr = 'NA';
                break;
            default:
                return parent::__construct($service, $id);
        }
        
        return;
    }

    /**
     * Always throws an error; updates are not permitted
     *
     * @throws NetworkUpdateError always
     */
    public function Update($params = array()) 
    {
        throw new Exceptions\NetworkUpdateError(Lang::translate('Isolated networks cannot be updated'));
    }

    /**
     * Deletes an isolated network
     *
     * @api
     * @return \OpenCloud\HttpResponse
     * @throws NetworkDeleteError if HTTP status is not Success
     */
    public function Delete() 
    {
        switch ($this->id) {
            case RAX_PUBLIC:
            case RAX_PRIVATE:
                throw new Exceptions\DeleteError('Network may not be deleted');
            default:
                return parent::Delete();
        }
    }
    
    /**
     * returns the visible name (label) of the network
     *
     * @api
     * @return string
     */
    public function Name() 
    {
        return $this->label;
    }

    /**
     * Creates the JSON object for the Create() method
     */
    protected function CreateJson() 
    {
        $obj = new \stdClass();
        $obj->network = new \stdClass();
        $obj->network->cidr = $this->cidr;
        $obj->network->label = $this->label;
        return $obj;
    }

}