Exemplo n.º 1
0
	def get(self, cloud_id = None):
		# lookup user's auth info
		user_info = User.get_by_id(long(self.user_id))
		
		# get the cloud in question
		cloud = Cloud.get_by_id(long(cloud_id))

		# bail if cloud doesn't exist or not owned by this user
		if not cloud or cloud.owner != user_info.key:
			return self.redirect_to('account-clouds')

		# look up cloud's instances
		instances = Instance.get_by_cloud(cloud.key)

		# setup channel to do page refresh
		channel_token = user_info.key.urlsafe()
		refresh_channel = channel.create_channel(channel_token)

		# params build out
		params = {
			'cloud': cloud,
			'instances': instances, 
			'refresh_channel': refresh_channel,
			'channel_token': channel_token 
		}

		return self.render_template('cloud/edit.html', **params)
Exemplo n.º 2
0
    def get(self, cloud_id=None):
        # lookup user's auth info
        user_info = User.get_by_id(long(self.user_id))

        # get the cloud in question
        cloud = Cloud.get_by_id(long(cloud_id))

        # bail if cloud doesn't exist or not owned by this user
        if not cloud or cloud.owner != user_info.key:
            return self.redirect_to('account-clouds')

        # look up cloud's instances
        instances = Instance.get_by_cloud(cloud.key)

        # setup channel to do page refresh
        channel_token = user_info.key.urlsafe()
        refresh_channel = channel.create_channel(channel_token)

        # params build out
        params = {
            'cloud': cloud,
            'instances': instances,
            'refresh_channel': refresh_channel,
            'channel_token': channel_token
        }

        return self.render_template('cloud/edit.html', **params)