Check if resource view exists in HDX and if so, update it, otherwise create resource view

        Returns:
            None
768836
def create_in_hdx(self):
        # type: () -> None
        
        self.check_required_fields()
        if not self._update_resource_view(log=True):
            self._save_to_hdx('create', 'title')
175549
def update_resources_from_dict(self, res, types=None, names=None, 
                                   languages=None):
        
        UpdateResourcesFromDict(self.filename, res, types, names, 
                                languages)
1005758
public static snmp_view update(nitro_service client, snmp_view resource) throws Exception
	{
		resource.validate("modify");
		return ((snmp_view[]) resource.update_resource(client))[0];
	}
319058
def _get_resource_view(self, resource_view):
        # type: (Union[ResourceView,Dict]) -> ResourceView
        
        if isinstance(resource_view, dict):
            resource_view = ResourceView(resource_view, configuration=self.configuration)
        if isinstance(resource_view, ResourceView):
            return resource_view
        raise HDXError('Type %s is not a valid resource view!' % type(resource_view).__name__)
1352440
def exists(self, path):
        
        import hdfs
        try:
            self.client.status(path)
            return True
        except hdfs.util.HdfsError as e:
            if str(e).startswith('File does not exist: '):
                return False
            else:
                raise e
980847
def create_from_file(file_path)
      client_setup
      resource = OneviewSDK::Resource.from_file(@client, file_path)
      fail_nice 'Failed to determine resource type!' if resource.class == OneviewSDK::Resource
      existing_resource = resource.class.new(@client, resource.data)
      resource.data.delete('uri')
      if existing_resource.retrieve!
        if options['if_missing']
          puts "Skipped: #{resource.class.name.split('::').last} '#{resource[:name]}' already exists.\n#{existing_resource[:uri]}"
          return
        end
        if existing_resource.like?(resource.data)
          puts "Skipped: #{resource.class.name.split('::').last} '#{resource[:name]}' is up to date.\n#{existing_resource[:uri]}"
          return
        end
        begin
          existing_resource.update(resource.data)
          puts "Updated Successfully!\n#{existing_resource[:uri]}"
        rescue StandardError => e
          fail_nice "Failed to update #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
        end
      else
        begin
          resource.create
          puts "Created Successfully!\n#{resource[:uri]}"
        rescue StandardError => e
          fail_nice "Failed to create #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
        end
      end
    rescue IncompleteResource => e
      fail_nice "Failed to create #{resource.class.name.split('::').last} '#{resource[:name]}': #{e}"
    rescue SystemCallError => e # File open errors
      fail_nice e
    end
810842
private void createViewIfNotExist(Map<String, MapReduce> views, String columnName)
    {
        if (views.get(columnName) == null)
        {
            createView(views, columnName);
        }
    }
1274011
def update_resources(self, dstpath, names=None, languages=None):
        
        UpdateManifestResourcesFromXML(dstpath, self.toprettyxml(), names, 
                                       languages)
358803
function refreshView() {
    if (!checkNoChangesMode) {
        executeInitHooks(viewData, tView, creationMode);
    }
    refreshDynamicEmbeddedViews(viewData);
    if (!checkNoChangesMode) {
        executeHooks(directives, tView.contentHooks, tView.contentCheckHooks, creationMode);
    }
    // This needs to be set before children are processed to support recursive components
    tView.firstTemplatePass = firstTemplatePass = false;
    setHostBindings(tView.hostBindings);
    refreshContentQueries(tView);
    refreshChildComponents(tView.components);
}
864717
def syncView(self):
        
        if not self.updatesEnabled():
            return
        
        for item in self.topLevelItems():
            try:
                item.syncView(recursive=True)
            except AttributeError:
                continue
147394
def call(self, name, request=None, **params):
        
        if name not in self.resources:
            raise exceptions.HttpError(
                'Unknown method \'%s\'' % name,
                status=status.HTTP_501_NOT_IMPLEMENTED)
        request = request or HttpRequest()
        resource = self.resources[name]
        view = resource.as_view(api=self)
        return view(request, **params)
136985
def resource_exists(self, name):
        """"""
        if name not in self.available:
            try:
                get_zoneinfo().getinfo('zoneinfo/' + name)
                self.available[name] = True
            except KeyError:
                self.available[name] = False

        return self.available[name]
168544
function ResourceView(opts) {
	var view = this;

	var compute_keys;
	if(opts && opts.compute_keys) {
		compute_keys = opts.compute_keys;
	}

	var element_keys;
	if(opts && opts.element_keys) {
		element_keys = opts.element_keys;
	}

	var collection_keys;
	if(opts && opts.collection_keys) {
		collection_keys = opts.collection_keys;
	}

	var element_post;
	if(opts && opts.element_post) {
		element_post = opts.element_post;
	}

	var collection_post;
	if(opts && opts.collection_post) {
		collection_post = opts.collection_post;
	}

	opts = copy(opts || {});

	debug.assert(opts).is('object');
	debug.assert(opts.path).is('string');

	view.opts = {};
	view.opts.keys = opts.keys || ['$id', '$type', '$ref'];
	view.opts.path = opts.path;
	view.opts.elementPath = opts.elementPath;

	view.Type = opts.Type;

	if(is.obj(compute_keys)) {
		view.compute_keys = compute_keys;
	}

	if(is.obj(element_keys)) {
		view.element_keys = element_keys;
	}

	if(is.obj(collection_keys)) {
		view.collection_keys = collection_keys;
	}

	if(is.func(element_post)) {
		view.element_post = element_post;
	}

	if(is.func(collection_post)) {
		view.collection_post = collection_post;
	}

	//debug.log("view.opts = ", view.opts);
}
85719
protected static void checkNotCreate(String view, String attribute, boolean create) {
    if (create) {
      throw new UnsupportedOperationException(
          "cannot set attribute '" + view + ":" + attribute + "' during file creation");
    }
  }
1159904
def update_or_create(cls, org, provider, exists):
        
        instance, created = cls.objects.update_or_create(
            org=org,
            provider=provider,
            defaults={'exists': exists},
        )

        return instance, created
404992
def update_resources(self, cpu, gpu, **kwargs):
        
        if self.status is Trial.RUNNING:
            raise ValueError("Cannot update resources while Trial is running.")
        self.resources = Resources(cpu, gpu, **kwargs)
182392
def _dataset_load_from_hdx(self, id_or_name):
        # type: (str) -> bool
        

        if not self._load_from_hdx('dataset', id_or_name):
            return False
        self._dataset_create_resources()
        return True